File tree Expand file tree Collapse file tree 3 files changed +51
-0
lines changed
Expand file tree Collapse file tree 3 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ env "local" {
2+ url = " postgres://user:pass@db:5432/local_db?sslmode=disable"
3+
4+ migration {
5+ dir = " file://migrations"
6+ format = " golang-migrate"
7+ }
8+ }
Original file line number Diff line number Diff line change 1+ -- modify: add 'published_at' to papers
2+ ALTER TABLE papers
3+ ADD COLUMN published_at TIMESTAMP ;
Original file line number Diff line number Diff line change 1+ schema "public" {
2+ charset = " UTF8"
3+ collate = " en_US.utf8"
4+ }
5+
6+ table "papers" {
7+ schema = schema. public
8+ column "id" {
9+ type = serial
10+ primary_key = true
11+ }
12+ column "title" {
13+ type = varchar (255 )
14+ null = false
15+ }
16+ }
17+
18+ table "mentions" {
19+ schema = schema. public
20+ column "id" {
21+ type = serial
22+ primary_key = true
23+ }
24+ column "paper_id" {
25+ type = int
26+ null = false
27+ }
28+ column "document" {
29+ type = text
30+ null = false
31+ }
32+
33+ foreign_key "mentions_paper_fk" {
34+ columns = [column . paper_id ]
35+ ref_table = table. papers
36+ ref_columns = [column . id ]
37+ on_delete = " CASCADE"
38+ }
39+ }
40+
You can’t perform that action at this time.
0 commit comments