-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmemory.sql
More file actions
28 lines (23 loc) · 729 Bytes
/
Copy pathmemory.sql
File metadata and controls
28 lines (23 loc) · 729 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
SET sql_safe_updates = FALSE;
USE defaultdb;
DROP DATABASE IF EXISTS test CASCADE;
CREATE DATABASE test;
USE test;
CREATE TABLE memories (
memory_id INT8 NOT NULL DEFAULT unique_rowid(),
title VARCHAR(60) NULL,
text VARCHAR NULL,
done BOOL NULL,
pub_date TIMESTAMP NULL,
CONSTRAINT "primary" PRIMARY KEY (memory_id ASC),
FAMILY "primary" (memory_id, title, text, done, pub_date)
);
CREATE TABLE users (
user_id INT8 NOT NULL DEFAULT unique_rowid(),
username VARCHAR(60) NULL,
email VARCHAR NULL,
password VARCHAR NULL,
create_date TIMESTAMP NULL,
CONSTRAINT "primary" PRIMARY KEY (user_id ASC),
FAMILY "primary" (user_id, username, email, password, create_date)
);