DROP TABLE meta CASCADE;
	
CREATE TABLE meta (
	id serial NOT NULL PRIMARY KEY,
	artist_id char(37),
	artist_name text,
	artist_sortname text,
	
	album_id char(37), 
	album_name text, 
	album_trackcount smallint,
	
	album_artist_id char(37),
	album_artist_name text,
	album_artist_sortname text,
	
	track_id char(37), 
	track_name text,
	track_number smallint,

	score float,

	filename text,

	updated timestamp DEFAULT NOW(),
	
	old_meta int DEFAULT NULL REFERENCES meta);
	
GRANT ALL ON meta TO audio_tagger;
GRANT ALL ON meta_id_seq TO audio_tagger;

-- artist_id, artits_name, artist_sortname, album_id, album_name, album_trackcount, album_artist_id, album_artits_name, album_artist_sortname, track_id, track_name, track_number, filename
