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)
);
