-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_database.sql
34 lines (30 loc) · 977 Bytes
/
setup_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
create database "tiripode";
\c tiripode;
-- remove tables if database already created
drop table if exists inflection;
drop table if exists form;
drop table if exists dict_entry;
create table if not exists dict_entry (
entryid serial primary key,
word varchar(50) not null,
entrydefinition text not null,
category varchar(20),
stem varchar(100)
);
create table if not exists form (
formid serial primary key,
-- case and number are reserved words :'(
formdeclension varchar(50) not null,
formcase varchar(50) not null,
formgender varchar(50) not null,
formnumber varchar(50) not null,
formending varchar(20) not null,
formpronunciation varchar(20) not null
);
create table if not exists inflection (
inflectionid serial primary key,
inflection varchar(50) not null,
form int references form(formid) not null,
dict_entry int references dict_entry(entryid) not null,
uncertaingender boolean not null
);