1DROP TABLE IF EXISTS test.documents;
2CREATE TABLE test.documents
3(
4	id			INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
5	group_id	INTEGER NOT NULL,
6	group_id2	INTEGER NOT NULL,
7	date_added	DATETIME NOT NULL,
8	title		VARCHAR(255) NOT NULL,
9	content		TEXT NOT NULL
10);
11
12REPLACE INTO test.documents ( id, group_id, group_id2, date_added, title, content ) VALUES
13	( 1, 1, 5, NOW(), 'test one', 'this is my test document number one. also checking search within phrases.' ),
14	( 2, 1, 6, NOW(), 'test two', 'this is my test document number two' ),
15	( 3, 2, 7, NOW(), 'another doc', 'this is another group' ),
16	( 4, 2, 8, NOW(), 'doc number four', 'this is to test groups' );
17
18DROP TABLE IF EXISTS test.tags;
19CREATE TABLE test.tags
20(
21	docid INTEGER NOT NULL,
22	tagid INTEGER NOT NULL,
23	UNIQUE(docid,tagid)
24);
25
26INSERT INTO test.tags VALUES
27	(1,1), (1,3), (1,5), (1,7),
28	(2,6), (2,4), (2,2),
29	(3,15),
30	(4,7), (4,40);
31