-------------------------------------------------------------------
-- @copyright  2009-2011 Roberto Perpuly
--
-- This source may not be redistributed without prior consent.  Access to the 
-- source does not imply that you have consent to redistribute either this source
-- code or the generated binary. See LICENSE file for details.
-------------------------------------------------------------------
--
-- This SQL file is the schema that stores functions of parsed JS files.
---
-- DO NOT ADD COMMENTS AFTER THIS LINE
---
CREATE TABLE resources(
	id INTEGER NOT NULL PRIMARY KEY,
	file_tag_id INTEGER NOT NULL,
	source_id INTEGER NOT NULL,
	key TEXT NOT NULL,
	identifier TEXT NOT NULL,
	signature TEXT NOT NULL,
	comment TEXT NOT NULL,
	line_number INTEGER NOT NULL,
	column_position INTEGER NOT NULL
);

CREATE TABLE file_tags_sources(
	source_id INTEGER NOT NULL,
	file_tag_id INTEGER NOT NULL
);

CREATE TABLE file_tags(
	file_tag_id INTEGER NOT NULL PRIMARY KEY,
	full_path TEXT,
	name TEXT NOT NULL COLLATE NOCASE,
	last_modified DATETIME NOT NULL,
	is_parsed INTEGER NOT NULL,
	is_new INTEGER NOT NULL
);

CREATE TABLE sources(
	source_id INTEGER NOT NULL PRIMARY KEY,
	directory TEXT NOT NULL
);
