-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathschema.sql
More file actions
36 lines (30 loc) · 779 Bytes
/
schema.sql
File metadata and controls
36 lines (30 loc) · 779 Bytes
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
create table clients (
id integer PRIMARY KEY AUTOINCREMENT,
name varchar(255),
phone_number varchar(255),
address varchar(255)
);
create table pets (
id integer PRIMARY KEY AUTOINCREMENT,
name varchar(255),
gender varchar(255),
altered boolean,
client_id integer,
FOREIGN KEY (client_id) REFERENCES clients(id)
);
create table users (
id integer PRIMARY KEY AUTOINCREMENT,
username varchar(255),
encoded_password varchar(255),
role varchar(255)
);
CREATE TABLE appointments (
id INTEGER PRIMARY KEY AUTOINCREMENT,
pet_id INTEGER NOT NULL,
client_id INTEGER NOT NULL,
reason TEXT(255) NOT NULL,
appt_time DATETIME NOT NULL,
duration INTEGER DEFAULT 0 NOT NULL,
comments TEXT(255)
);
insert into users values (null, 'admin', 'password', 'SUPER_ADMIN');