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