summaryrefslogtreecommitdiffstats
path: root/pkg/database/migrations/0001_initial.sql
blob: 5e692294af37712cddf0d302a592a9ca5d582551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- +goose Up

CREATE TABLE entries (
  id          integer PRIMARY KEY,
  title       text    NOT NULL,
  kind        integer NOT NULL,
  url         text    NOT NULL,
  description text    NOT NULL,
  timestamp   text    NOT NULL DEFAULT CURRENT_TIMESTAMP,
  FOREIGN KEY(kind) REFERENCES kinds(id)
) STRICT;

CREATE TABLE kinds (
  id    integer PRIMARY KEY,
  name  text    NOT NULL,
  emoji text    NOT NULL
) STRICT;

CREATE INDEX idx_kinds_name ON kinds(name);