don't need tags.sql
This commit is contained in:
parent
a96decdf2e
commit
7b0b20e267
194
db_schema.sql
194
db_schema.sql
@ -1,73 +1,121 @@
|
|||||||
-- Database export via SQLPro (https://www.sqlprostudio.com/)
|
-- Database export via SQLPro (https://www.sqlprostudio.com/)
|
||||||
-- Exported by camille at 27-01-2025 12:25.
|
-- Exported by camille at 27-01-2025 14:35.
|
||||||
-- WARNING: This file may contain descructive statements such as DROPs.
|
-- WARNING: This file may contain descructive statements such as DROPs.
|
||||||
-- Please ensure that you are running the script at the proper location.
|
-- Please ensure that you are running the script at the proper location.
|
||||||
|
|
||||||
|
|
||||||
-- BEGIN TABLE public.instances
|
-- BEGIN TABLE public.instances
|
||||||
DROP TABLE IF EXISTS public.instances CASCADE;
|
DROP TABLE IF EXISTS public.instances CASCADE;
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public.instances (
|
CREATE TABLE IF NOT EXISTS public.instances (
|
||||||
id bigint DEFAULT nextval('insances_sampleid_seq'::regclass) NOT NULL,
|
id bigint DEFAULT nextval('insances_sampleid_seq'::regclass) NOT NULL,
|
||||||
instance character varying NOT NULL,
|
instance character varying NOT NULL,
|
||||||
record_update_by bigint,
|
record_update_by bigint,
|
||||||
record_updated_at timestamp without time zone,
|
record_updated_at timestamp without time zone,
|
||||||
vote integer DEFAULT 1 NOT NULL,
|
vote integer DEFAULT 1 NOT NULL,
|
||||||
PRIMARY KEY(id)
|
PRIMARY KEY(id)
|
||||||
);
|
);
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
-- END TABLE public.instances
|
-- END TABLE public.instances
|
||||||
|
|
||||||
-- BEGIN TABLE public.receipts
|
-- BEGIN TABLE public.receipt_tags
|
||||||
DROP TABLE IF EXISTS public.receipts CASCADE;
|
DROP TABLE IF EXISTS public.receipt_tags CASCADE;
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public.receipts (
|
CREATE TABLE IF NOT EXISTS public.receipt_tags (
|
||||||
id bigint DEFAULT nextval('receipts_sampleid_seq'::regclass) NOT NULL,
|
id bigint DEFAULT nextval('receipt_tags_sampleid_seq'::regclass) NOT NULL,
|
||||||
instance_id bigint NOT NULL,
|
instance_id bigint NOT NULL,
|
||||||
updated_by bigint,
|
receipt_id bigint,
|
||||||
updated_at timestamp without time zone,
|
tag_id bigint NOT NULL,
|
||||||
original_link character varying NOT NULL,
|
PRIMARY KEY(id)
|
||||||
image_filename character varying,
|
);
|
||||||
PRIMARY KEY(id)
|
|
||||||
);
|
COMMIT;
|
||||||
|
|
||||||
COMMIT;
|
-- END TABLE public.receipt_tags
|
||||||
|
|
||||||
-- END TABLE public.receipts
|
-- BEGIN TABLE public.receipts
|
||||||
|
DROP TABLE IF EXISTS public.receipts CASCADE;
|
||||||
-- BEGIN TABLE public.users
|
BEGIN;
|
||||||
DROP TABLE IF EXISTS public.users CASCADE;
|
|
||||||
BEGIN;
|
CREATE TABLE IF NOT EXISTS public.receipts (
|
||||||
|
id bigint DEFAULT nextval('receipts_sampleid_seq'::regclass) NOT NULL,
|
||||||
CREATE TABLE IF NOT EXISTS public.users (
|
instance_id bigint NOT NULL,
|
||||||
id bigint DEFAULT nextval('users_sampleid_seq'::regclass) NOT NULL,
|
updated_by bigint,
|
||||||
username character varying NOT NULL,
|
updated_at timestamp without time zone,
|
||||||
fullname character varying,
|
original_link character varying NOT NULL,
|
||||||
fedi_address character varying NOT NULL,
|
image_filename character varying,
|
||||||
active boolean DEFAULT true NOT NULL,
|
PRIMARY KEY(id)
|
||||||
PRIMARY KEY(id)
|
);
|
||||||
);
|
|
||||||
|
COMMIT;
|
||||||
COMMIT;
|
|
||||||
|
-- END TABLE public.receipts
|
||||||
-- END TABLE public.users
|
|
||||||
|
-- BEGIN TABLE public.tags
|
||||||
ALTER TABLE IF EXISTS public.instances
|
DROP TABLE IF EXISTS public.tags CASCADE;
|
||||||
ADD CONSTRAINT instances_users_fk
|
BEGIN;
|
||||||
FOREIGN KEY (record_update_by)
|
|
||||||
REFERENCES public.users (id);
|
CREATE TABLE IF NOT EXISTS public.tags (
|
||||||
|
id bigint DEFAULT nextval('tags_sampleid_seq'::regclass) NOT NULL,
|
||||||
ALTER TABLE IF EXISTS public.receipts
|
tag_name character varying NOT NULL,
|
||||||
ADD CONSTRAINT instance_id_fkey
|
tag_description character varying NOT NULL,
|
||||||
FOREIGN KEY (instance_id)
|
PRIMARY KEY(id)
|
||||||
REFERENCES public.instances (id)
|
);
|
||||||
ON DELETE CASCADE;
|
|
||||||
|
COMMIT;
|
||||||
ALTER TABLE IF EXISTS public.receipts
|
|
||||||
ADD CONSTRAINT update_by_fkey
|
-- END TABLE public.tags
|
||||||
FOREIGN KEY (updated_by)
|
|
||||||
REFERENCES public.users (id);
|
-- BEGIN TABLE public.users
|
||||||
|
DROP TABLE IF EXISTS public.users CASCADE;
|
||||||
|
BEGIN;
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS public.users (
|
||||||
|
id bigint DEFAULT nextval('users_sampleid_seq'::regclass) NOT NULL,
|
||||||
|
username character varying NOT NULL,
|
||||||
|
fullname character varying,
|
||||||
|
fedi_address character varying NOT NULL,
|
||||||
|
active boolean DEFAULT true NOT NULL,
|
||||||
|
PRIMARY KEY(id)
|
||||||
|
);
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
-- END TABLE public.users
|
||||||
|
|
||||||
|
ALTER TABLE IF EXISTS public.instances
|
||||||
|
ADD CONSTRAINT instances_users_fk
|
||||||
|
FOREIGN KEY (record_update_by)
|
||||||
|
REFERENCES public.users (id);
|
||||||
|
|
||||||
|
ALTER TABLE IF EXISTS public.receipt_tags
|
||||||
|
ADD CONSTRAINT instance_id_fkey
|
||||||
|
FOREIGN KEY (instance_id, instance_id)
|
||||||
|
REFERENCES public.instances (id, id)
|
||||||
|
ON DELETE CASCADE;
|
||||||
|
|
||||||
|
ALTER TABLE IF EXISTS public.receipt_tags
|
||||||
|
ADD CONSTRAINT tag_id
|
||||||
|
FOREIGN KEY (tag_id)
|
||||||
|
REFERENCES public.tags (id);
|
||||||
|
|
||||||
|
ALTER TABLE IF EXISTS public.receipt_tags
|
||||||
|
ADD CONSTRAINT receipt_id_fkey
|
||||||
|
FOREIGN KEY (receipt_id)
|
||||||
|
REFERENCES public.receipts (id);
|
||||||
|
|
||||||
|
ALTER TABLE IF EXISTS public.receipts
|
||||||
|
ADD CONSTRAINT instance_id_fkey
|
||||||
|
FOREIGN KEY (instance_id, instance_id)
|
||||||
|
REFERENCES public.instances (id, id)
|
||||||
|
ON DELETE CASCADE;
|
||||||
|
|
||||||
|
ALTER TABLE IF EXISTS public.receipts
|
||||||
|
ADD CONSTRAINT update_by_fkey
|
||||||
|
FOREIGN KEY (updated_by)
|
||||||
|
REFERENCES public.users (id);
|
||||||
|
|
||||||
|
42
tags.sql
42
tags.sql
@ -1,42 +0,0 @@
|
|||||||
-- Database export via SQLPro (https://www.sqlprostudio.com/)
|
|
||||||
-- Exported by camille at 27-01-2025 14:30.
|
|
||||||
-- WARNING: This file may contain descructive statements such as DROPs.
|
|
||||||
-- Please ensure that you are running the script at the proper location.
|
|
||||||
|
|
||||||
|
|
||||||
-- BEGIN TABLE public.tags
|
|
||||||
DROP TABLE IF EXISTS public.tags CASCADE;
|
|
||||||
BEGIN;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS public.tags (
|
|
||||||
id bigint DEFAULT nextval('tags_sampleid_seq'::regclass) NOT NULL,
|
|
||||||
tag_name character varying NOT NULL,
|
|
||||||
tag_description character varying NOT NULL,
|
|
||||||
PRIMARY KEY(id)
|
|
||||||
);
|
|
||||||
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
-- Inserting 17 rows into public.tags
|
|
||||||
-- Insert batch #1
|
|
||||||
INSERT INTO public.tags (id, tag_name, tag_description) VALUES
|
|
||||||
(1, 'spam', 'spam'),
|
|
||||||
(2, 'ads', 'predatory advertising'),
|
|
||||||
(3, 'antiblackness', 'open anti-black hostility'),
|
|
||||||
(4, 'homomisia', 'open same-sex relationship hostility'),
|
|
||||||
(5, 'transmisia', 'open transgender hostility'),
|
|
||||||
(6, 'antisemetism', 'open anti-jewish hostility'),
|
|
||||||
(7, 'ableism', 'open anti-disability hostility'),
|
|
||||||
(8, 'csam', 'child sexual abuse material'),
|
|
||||||
(9, 'nudity', 'nudity without content warnings'),
|
|
||||||
(10, 'misogyny', 'open hostility towards women'),
|
|
||||||
(11, 'misogynoir', 'open hostility towards black women'),
|
|
||||||
(12, 'harassment', 'continued, targeted abuse'),
|
|
||||||
(13, 'misandry', 'open hostility towards men'),
|
|
||||||
(14, 'violence', 'targeted speech meant to convey violent actions'),
|
|
||||||
(15, 'doxing', 'deliberate actions to publicise the identity of others'),
|
|
||||||
(16, 'TERFs', 'Trans Exclusionary Radical Feminism'),
|
|
||||||
(17, 'xenophobia', 'open hostility to foreigners/immigrants');
|
|
||||||
|
|
||||||
-- END TABLE public.tags
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user