Initial commit; adaptation from mascarpone
This commit is contained in:
commit
3d45ec4b0a
36 changed files with 5877 additions and 0 deletions
25
migrations/demo.sql
Normal file
25
migrations/demo.sql
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
-- (1, 'daily'),
|
||||
-- (2, 'weekly'),
|
||||
-- (3, 'fortnightly'),
|
||||
-- (4, 'monthly'),
|
||||
-- (5, 'seasonally'),
|
||||
-- (6, 'semiannually'),
|
||||
-- (7, 'yearly')
|
||||
insert into tasks (description, frequency_id) values
|
||||
('**Kitchen**: Tidy', 2),
|
||||
('**Kitchen**: Wipe counters', 2),
|
||||
('**Dining**: Tidy', 2),
|
||||
('**Dining**: Wipe table', 2),
|
||||
('**Kitchen**: Clean sink', 3),
|
||||
('**Bathroom**: Change towels', 3),
|
||||
('**Bathroom**: Tidy', 3),
|
||||
('**Bathroom**: Wipe counters & sinks', 4),
|
||||
('**Bathroom**: Sweep/vacuum', 4),
|
||||
('**Bathroom**: Empty trash', 4),
|
||||
('**Bathroom**: Clean toilets', 4),
|
||||
('Mirrors', 5),
|
||||
('**kitchen**: Verticals', 5),
|
||||
('Clean oven', 6),
|
||||
('Wash dish rack', 6),
|
||||
('Oil hinges', 7),
|
||||
('Wash patio', 7);
|
||||
27
migrations/each_user/0001_task-tables.sql
Normal file
27
migrations/each_user/0001_task-tables.sql
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
create table if not exists frequencies (
|
||||
id integer primary key autoincrement,
|
||||
description text not null default ''
|
||||
);
|
||||
|
||||
insert into frequencies (id, description) values
|
||||
(1, 'daily'),
|
||||
(2, 'weekly'),
|
||||
(3, 'fortnightly'),
|
||||
(4, 'monthly'),
|
||||
(5, 'seasonally'),
|
||||
(6, 'semiannually'),
|
||||
(7, 'yearly')
|
||||
on conflict (id) do update set description=excluded.description;
|
||||
|
||||
|
||||
create table if not exists tasks (
|
||||
id integer primary key autoincrement,
|
||||
description text not null default '',
|
||||
frequency_id integer not null references frequencies(id) on delete cascade
|
||||
);
|
||||
|
||||
create table if not exists completions (
|
||||
id integer primary key autoincrement,
|
||||
task_id integer not null references tasks(id) on delete cascade,
|
||||
datestamp text not null
|
||||
);
|
||||
6
migrations/users.db/01_create-users.sql
Normal file
6
migrations/users.db/01_create-users.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
create table if not exists users (
|
||||
id integer primary key autoincrement,
|
||||
username not null unique,
|
||||
password not null,
|
||||
ephemeral boolean not null default false
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue