-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.sql
39 lines (34 loc) · 1.2 KB
/
database.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
DROP TABLE if exists users;
DROP TABLE if exists projects;
DROP TABLE if exists fields;
DROP TABLE if exists records;
DROP TABLE if exists batches;
CREATE TABLE Batches (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
FilePath TEXT NOT NULL ,
ProjectId INTEGER NOT NULL,
UserId INTEGER,
IsIndexed BOOL DEFAULT FALSE);
CREATE TABLE Fields (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
ProjectId INTEGER NOT NULL,
Name TEXT NOT NULL,
XCoord INTEGER NOT NULL,
Width INTEGER NOT NULL,
HelpHtml TEXT,
KnownData TEXT);
CREATE TABLE Projects (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
Title TEXT NOT NULL UNIQUE,
RecordsPerImage INTEGER NOT NULL,
FirstYCoord INTEGER NOT NULL,
RecordHeight INTEGER NOT NULL);
CREATE TABLE Records (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
Value TEXT NOT NULL ,
FieldId INTEGER NOT NULL ,
BatchId INTEGER NOT NULL );
CREATE TABLE Users (Id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
UserName TEXT NOT NULL UNIQUE ,
Password TEXT NOT NULL ,
FirstName TEXT,
LastName TEXT,
Email TEXT,
IndexedRecords INTEGER DEFAULT 0,
BatchID INTEGER);