j@215: (cl:in-package #:amuse-meredith) j@215: j@215: (defun create-meredith-tables (database) j@215: (%create-compositions-table database) j@215: (%create-events-table database)) j@215: j@215: (defun drop-meredith-tables (database) j@215: (%drop-compositions-table database) j@215: (%drop-events-table database)) j@215: j@215: j@215: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; j@215: ;;; Helper functions j@215: j@215: (defun %create-compositions-table (database) j@215: #.(clsql:locally-enable-sql-reader-syntax) j@215: (clsql:create-table "meredith_compositions" j@215: '(([|composition-id|] clsql:smallint :unsigned j@215: :not-null :auto-increment :primary-key) j@215: ([|description|] (clsql:varchar 255) j@215: :not-null)) j@215: :database database j@215: :transactions t) j@215: #.(clsql:locally-disable-sql-reader-syntax)) j@215: j@215: (defun %create-events-table (database) j@215: #.(clsql:locally-enable-sql-reader-syntax) j@215: (clsql:create-table "meredith_events" j@215: '(([|composition-id|] clsql:smallint :unsigned j@215: :not-null) j@215: ([|event-id|] clsql:smallint :unsigned j@215: :not-null :auto-increment :unique) j@215: ([|tatum-on|] clsql:smallint :unsigned :not-null) j@215: ([|pitch-name|] (clsql:varchar 32) :not-null) j@215: ([|tatum-dur|] clsql:smallint :unsigned :not-null) j@215: ([|voice|] clsql:smallint :unsigned :not-null) j@215: ([|tactus-on|] clsql::float :unsigned :not-null) j@215: ([|tactus-dur|] clsql::float :unsigned :not-null) j@215: ([|crot-on|] clsql::float :unsigned :not-null) j@215: ([|crot-dur|] clsql::float :unsigned :not-null) j@215: ([|midi-note-number|] clsql:smallint :unsigned :not-null) j@215: ([|chrom-pitch|] clsql:smallint :unsigned :not-null) j@215: ([|morph-pitch|] clsql:smallint :unsigned :not-null) j@215: ([|tatum-on-ms|] clsql:smallint :unsigned :not-null) j@215: ([|tatum-dur-ms|] clsql:smallint :unsigned :not-null) j@215: ([|beat-on-ms|] clsql:smallint :unsigned :not-null) j@215: ([|beat-dur-ms|] clsql:smallint :unsigned :not-null) j@215: ([|crot-on-ms|] clsql:smallint :unsigned :not-null) j@215: ([|crot-dur-ms|] clsql:smallint :unsigned :not-null)) j@215: :constraints '("PRIMARY KEY (composition_id, event_id)") j@215: :database database j@215: :transactions t) j@215: #.(clsql:locally-disable-sql-reader-syntax)) j@215: j@215: (defun %drop-compositions-table (database) j@215: (clsql:drop-table "meredith_compositions" j@215: :database database)) j@215: j@215: (defun %drop-events-table (database) j@215: (clsql:drop-table "meredith_events" j@215: :database database))