CREATE TABLE artist (
  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  name TEXT NOT NULL,
  initial VARCHAR(4) NOT NULL,
  entry_time DATETIME NOT NULL,
  911_link TEXT NULL,
  PRIMARY KEY(id)
);

CREATE TABLE artist_tag (
  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  artist_id INTEGER UNSIGNED NOT NULL,
  tag TEXT NULL,
  entry_time DATETIME NULL,
  PRIMARY KEY(id),
  INDEX artist_tag_FKIndex1(artist_id)
);

CREATE TABLE new_update (
  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  last_update DATETIME NOT NULL,
  file_name TEXT NULL,
  PRIMARY KEY(id)
);

CREATE TABLE song (
  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  artist_id INTEGER UNSIGNED NOT NULL,
  name TEXT NOT NULL,
  download_count INTEGER UNSIGNED NULL DEFAULT 0,
  entry_time DATETIME NOT NULL,
  911_link TEXT NULL,
  PRIMARY KEY(id),
  INDEX music_FKIndex1(artist_id)
);

CREATE TABLE song_tag (
  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  song_id INTEGER UNSIGNED NOT NULL,
  tag TEXT NULL,
  entry_time DATETIME NULL,
  PRIMARY KEY(id),
  INDEX music_tag_FKIndex1(song_id)
);

CREATE TABLE tab (
  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  artist_id INTEGER UNSIGNED NOT NULL,
  song_id INTEGER UNSIGNED NOT NULL,
  site_name VARCHAR(255) NULL,
  site_link TEXT NOT NULL,
  tab_type VARCHAR(16) NULL,
  part VARCHAR(16) NULL,
  rating DOUBLE NULL,
  entry_time DATETIME NOT NULL,
  911_link TEXT NULL,
  PRIMARY KEY(id),
  INDEX tab_FKIndex1(artist_id),
  INDEX tab_FKIndex2(song_id)
);


