-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathproject_schema.sql
More file actions
93 lines (75 loc) · 2.42 KB
/
project_schema.sql
File metadata and controls
93 lines (75 loc) · 2.42 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
PRAGMA foreign_keys = OFF
drop table if exists COMMANDS
drop table if exists COMMAND_PROPERTIES
drop table if exists DATA_REPOSITORIES
drop table if exists ENTITIES
drop table if exists SIMULATIONS
drop table if exists HISTORY_ITEMS
drop table if exists CONTENTS
drop table if exists PROJECTS
PRAGMA foreign_keys = ON
create table COMMANDS (
Id TEXT not null,
CommandId TEXT not null,
Discriminator TEXT not null,
CommandInverseId TEXT,
CommandType TEXT,
ObjectType TEXT,
Description TEXT,
ExtendedDescription TEXT,
Visible INTEGER,
Comment TEXT,
Sequence INTEGER,
ParentId TEXT,
primary key (Id),
constraint FK_DD4B87FE foreign key (ParentId) references COMMANDS
)
create table COMMAND_PROPERTIES (
Id integer primary key autoincrement,
Name TEXT,
Value TEXT,
CommandId TEXT,
constraint FK_71C9276E foreign key (CommandId) references COMMANDS
)
create table DATA_REPOSITORIES (
Id TEXT not null,
ContentId INTEGER,
SimulationId TEXT,
primary key (Id),
constraint fk_DataRepository_Content foreign key (ContentId) references CONTENTS,
constraint FK_524447BC foreign key (SimulationId) references SIMULATIONS
)
create table ENTITIES (
Id TEXT not null,
Discriminator TEXT not null,
ContentId INTEGER,
ProjectId INTEGER,
primary key (Id),
constraint fk_Entity_Content foreign key (ContentId) references CONTENTS,
constraint FK_9F0A793C foreign key (ProjectId) references PROJECTS
)
create table SIMULATIONS (
SimulationId TEXT not null,
primary key (SimulationId),
constraint FK_A2608560 foreign key (SimulationId) references ENTITIES
)
create table HISTORY_ITEMS (
Id TEXT not null,
UserId TEXT,
DateTime TEXT,
State INTEGER,
Sequence INTEGER,
CommandId TEXT,
primary key (Id),
constraint fk_HistoryItem_Command foreign key (CommandId) references COMMANDS
)
create table CONTENTS (
Id integer primary key autoincrement,
Data image
)
create table PROJECTS (
Id integer primary key autoincrement,
Version INTEGER,
ContentId INTEGER,
constraint fk_Project_Content foreign key (ContentId) references CONTENTS
)