major features update
This commit is contained in:
parent
519fb49901
commit
4e2fab67c5
48 changed files with 3925 additions and 208 deletions
12
migrations/demo.db/0001_contact-tables.sql
Normal file
12
migrations/demo.db/0001_contact-tables.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
create table if not exists contacts (
|
||||
id integer primary key autoincrement,
|
||||
birthday text,
|
||||
manually_freshened_at date -- text, iso8601 date
|
||||
);
|
||||
|
||||
create table if not exists names (
|
||||
id integer primary key,
|
||||
contact_id integer not null references contacts(id) on delete cascade,
|
||||
sort integer not null,
|
||||
name text not null
|
||||
);
|
||||
13
migrations/demo.db/0002_journal-entry-tables.sql
Normal file
13
migrations/demo.db/0002_journal-entry-tables.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
create table if not exists journal_entries (
|
||||
id integer primary key autoincrement,
|
||||
value text not null,
|
||||
date text not null
|
||||
);
|
||||
|
||||
create table if not exists contact_mentions (
|
||||
entry_id integer not null references journal_entries(id) on delete cascade,
|
||||
contact_id integer not null references contacts(id) on delete cascade,
|
||||
input_text text not null,
|
||||
byte_range_start integer not null,
|
||||
byte_range_end integer not null
|
||||
);
|
||||
33
migrations/demo.db/0003_demo-data.sql
Normal file
33
migrations/demo.db/0003_demo-data.sql
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
INSERT INTO contacts(id, birthday, manually_freshened_at)
|
||||
values (0, '--0415', '2000-01-01T12:00:00');
|
||||
INSERT INTO names(contact_id, sort, name)
|
||||
values (0, 0, 'Alex Aaronson');
|
||||
INSERT INTO names(contact_id, sort, name)
|
||||
values (0, 1, 'Alexi');
|
||||
INSERT INTO names(contact_id, sort, name)
|
||||
values (0, 2, 'Алексей');
|
||||
INSERT INTO contacts(id, birthday)
|
||||
values (1, 'April?');
|
||||
INSERT INTO names(contact_id, sort, name)
|
||||
values (1, 0, 'Bazel Bagend');
|
||||
INSERT INTO contacts(id, birthday)
|
||||
values (2, '19951018');
|
||||
INSERT INTO names(contact_id, sort, name)
|
||||
values (2, 0, 'Charlie Certaindate');
|
||||
|
||||
insert into journal_entries(id, date, value)
|
||||
values (0, '2020-02-27', 'Lunch with [[Bazel Bagend]] and his wife');
|
||||
insert into journal_entries(id, value, date)
|
||||
values (1, 'Dinner with [[Alexi]]', '2025-10-10');
|
||||
insert into journal_entries(id, date, value)
|
||||
values (2, '2022-06-06', 'Movies with [[Daniel Doesn''texist]] et al');
|
||||
|
||||
insert into contact_mentions(
|
||||
entry_id, contact_id, input_text,
|
||||
byte_range_start, byte_range_end
|
||||
) values (0, 1, 'Bazel Bagend', 11, 27);
|
||||
|
||||
insert into contact_mentions(
|
||||
entry_id, contact_id, input_text,
|
||||
byte_range_start, byte_range_end
|
||||
) values (1, 0, 'Alexi', 12, 21);
|
||||
6
migrations/demo.db/0004_user-settings.sql
Normal file
6
migrations/demo.db/0004_user-settings.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
create table if not exists settings (
|
||||
id integer primary key,
|
||||
ics_path text
|
||||
);
|
||||
|
||||
insert into settings (id) values (1) on conflict (id) do nothing;
|
||||
6
migrations/demo.db/0005_address-tables.sql
Normal file
6
migrations/demo.db/0005_address-tables.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
create table if not exists addresses (
|
||||
id integer primary key,
|
||||
contact_id integer not null references contacts(id) on delete cascade,
|
||||
label text,
|
||||
value text not null
|
||||
);
|
||||
12
migrations/each_user/0001_contact-tables.sql
Normal file
12
migrations/each_user/0001_contact-tables.sql
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
create table if not exists contacts (
|
||||
id integer primary key autoincrement,
|
||||
birthday text,
|
||||
manually_freshened_at date -- text, iso8601 date
|
||||
);
|
||||
|
||||
create table if not exists names (
|
||||
id integer primary key,
|
||||
contact_id integer not null references contacts(id) on delete cascade,
|
||||
sort integer not null,
|
||||
name text not null
|
||||
);
|
||||
13
migrations/each_user/0002_journal-entry-tables.sql
Normal file
13
migrations/each_user/0002_journal-entry-tables.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
create table if not exists journal_entries (
|
||||
id integer primary key autoincrement,
|
||||
value text not null,
|
||||
date text not null
|
||||
);
|
||||
|
||||
create table if not exists contact_mentions (
|
||||
entry_id integer not null references journal_entries(id) on delete cascade,
|
||||
contact_id integer not null references contacts(id) on delete cascade,
|
||||
input_text text not null,
|
||||
byte_range_start integer not null,
|
||||
byte_range_end integer not null
|
||||
);
|
||||
6
migrations/each_user/0004_user-settings.sql
Normal file
6
migrations/each_user/0004_user-settings.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
create table if not exists settings (
|
||||
id integer primary key,
|
||||
ics_path text
|
||||
);
|
||||
|
||||
insert into settings (id) values (1) on conflict (id) do nothing;
|
||||
6
migrations/each_user/0005_address-tables.sql
Normal file
6
migrations/each_user/0005_address-tables.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
create table if not exists addresses (
|
||||
id integer primary key,
|
||||
contact_id integer not null references contacts(id) on delete cascade,
|
||||
label text,
|
||||
value text not null
|
||||
);
|
||||
5
migrations/users.db/01_create-users.sql
Normal file
5
migrations/users.db/01_create-users.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
create table if not exists users (
|
||||
id integer primary key autoincrement,
|
||||
username not null unique,
|
||||
password not null
|
||||
);
|
||||
5
migrations/users.db/02_add-ephemeral.sql
Normal file
5
migrations/users.db/02_add-ephemeral.sql
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
alter table users add column
|
||||
ephemeral boolean not null default false
|
||||
;
|
||||
|
||||
update users set ephemeral = false where ephemeral is null;
|
||||
Loading…
Add table
Add a link
Reference in a new issue