sample-amp/migrations/2023-06-15-080643_create_samples/up.sql

20 lines
481 B
SQL

CREATE TABLE samples (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
name VARCHAR NOT NULL,
path VARCHAR NOT NULL,
bpm REAL,
key VARCHAR
);
CREATE TABLE tags (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
name VARCHAR NOT NULL
);
CREATE TABLE samples_tags (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
sample_id INTEGER NOT NULL,
tag_id INTEGER NOT NULL,
FOREIGN KEY (sample_id) REFERENCES samples (id),
FOREIGN KEY (tag_id) REFERENCES tags (id)
);