repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
4a41efe
parent
23a8de6
author
Eric Bower
date
2022-12-15 14:05:03 +0000 UTC
fix(feeds): add feeds space to posts
2 files changed,  +55, -1
M Makefile
+2, -1
 1@@ -73,10 +73,11 @@ migrate:
 2 	docker exec -i $(DB_CONTAINER) psql -U $(PGUSER) -d $(PGDATABASE) < ./sql/migrations/20220811_add_data_to_post.sql
 3 	docker exec -i $(DB_CONTAINER) psql -U $(PGUSER) -d $(PGDATABASE) < ./sql/migrations/20220811_add_feature.sql
 4 	docker exec -i $(DB_CONTAINER) psql -U $(PGUSER) -d $(PGDATABASE) < ./sql/migrations/20221108_add_expires_at_to_posts.sql
 5+	docker exec -i $(DB_CONTAINER) psql -U $(PGUSER) -d $(PGDATABASE) < ./sql/migrations/20221112_add_feeds_space.sql
 6 .PHONY: migrate
 7 
 8 latest:
 9-	docker exec -i $(DB_CONTAINER) psql -U $(PGUSER) -d $(PGDATABASE) < ./sql/migrations/20221108_add_expires_at_to_posts.sql
10+	docker exec -i $(DB_CONTAINER) psql -U $(PGUSER) -d $(PGDATABASE) < ./sql/migrations/20221112_add_feeds_space.sql
11 .PHONY: latest
12 
13 psql:
A sql/migrations/20221112_add_feeds_space.sql
+53, -0
 1@@ -0,0 +1,53 @@
 2+ALTER TYPE space ADD VALUE 'feeds';
 3+
 4+-- CREATE TABLE IF NOT EXISTS feeds (
 5+--   id          uuid NOT NULL DEFAULT uuid_generate_v4(),
 6+--   user_id     uuid NOT NULL,
 7+--   post_id     uuid NOT NULL,
 8+--   atom_id     character varying(250),
 9+--   title       character varying(250),
10+--   subtitle    character varying(250),
11+--   author      character varying(250),
12+--   link        character varying(2000),
13+--   fetched_at  timestamp without time zone,
14+--   created_at  timestamp without time zone NOT NULL DEFAULT NOW(),
15+--   updated_at  timestamp without time zone NOT NULL DEFAULT NOW(),
16+--   CONSTRAINT  entry_unique_id UNIQUE (post_id, atom_id),
17+--   CONSTRAINT  feed_pkey PRIMARY KEY (id),
18+--   CONSTRAINT  fk_user_posts
19+--     FOREIGN KEY(user_id)
20+--   REFERENCES app_users(id)
21+--   ON DELETE CASCADE
22+--   ON UPDATE CASCADE,
23+--   CONSTRAINT fk_feed_posts
24+--     FOREIGN KEY(post_id)
25+--   REFERENCES posts(id)
26+--   ON DELETE CASCADE
27+--   ON UPDATE CASCADE
28+-- );
29+--
30+-- CREATE TABLE IF NOT EXISTS feed_entry (
31+--   id          uuid NOT NULL DEFAULT uuid_generate_v4(),
32+--   feed_id     uuid NOT NULL,
33+--   atom_id     character varying(250),
34+--   read        boolean NOT NULL DEFAULT false,
35+--   author      character varying(250),
36+--   category    character varying(250),
37+--   rights      character varying(2000),
38+--   source      character varying(2000),
39+--   content     text,
40+--   contributor character varying(250),
41+--   link        character varying(2000),
42+--   summary     text,
43+--   title       character varying(250),
44+--   published   timestamp without time zone NOT NULL DEFAULT NOW(),
45+--   created_at  timestamp without time zone NOT NULL DEFAULT NOW(),
46+--   updated_at  timestamp without time zone NOT NULL DEFAULT NOW(),
47+--   CONSTRAINT  entry_unique_atom_id UNIQUE (feed_id, atom_id),
48+--   CONSTRAINT  feed_entry_pkey PRIMARY KEY (id),
49+--   CONSTRAINT  fk_entry_feed
50+--     FOREIGN KEY(feed_id)
51+--   REFERENCES feeds(id)
52+--   ON DELETE CASCADE
53+--   ON UPDATE CASCADE
54+-- );