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