mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
Create blocked domains #2564
This commit is contained in:
parent
cd277c25ed
commit
d93d43e75c
13 changed files with 254 additions and 80 deletions
215
db/structure.sql
215
db/structure.sql
|
@ -41,7 +41,7 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text
|
|||
ret text;
|
||||
BEGIN
|
||||
-- define filters
|
||||
include_filter = '%' || i_origin;
|
||||
include_filter = '%.' || i_origin;
|
||||
|
||||
-- for %.%.%
|
||||
IF i_origin ~ '\.' THEN
|
||||
|
@ -74,7 +74,7 @@ CREATE FUNCTION generate_zonefile(i_origin character varying) RETURNS text
|
|||
SELECT concat(d.name_puny, '. IN NS ', ns.hostname, '.')
|
||||
FROM domains d
|
||||
JOIN nameservers ns ON ns.domain_id = d.id
|
||||
WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter
|
||||
WHERE d.name LIKE include_filter AND d.name NOT LIKE exclude_filter OR d.name = i_origin
|
||||
ORDER BY d.name
|
||||
),
|
||||
chr(10)
|
||||
|
@ -198,7 +198,7 @@ CREATE TABLE account_activities (
|
|||
id integer NOT NULL,
|
||||
account_id integer,
|
||||
invoice_id integer,
|
||||
sum numeric(10,2),
|
||||
sum numeric(8,2),
|
||||
currency character varying,
|
||||
bank_transaction_id integer,
|
||||
created_at timestamp without time zone,
|
||||
|
@ -236,7 +236,7 @@ CREATE TABLE accounts (
|
|||
id integer NOT NULL,
|
||||
registrar_id integer,
|
||||
account_type character varying,
|
||||
balance numeric(10,2) DEFAULT 0 NOT NULL,
|
||||
balance numeric(8,2) DEFAULT 0.0 NOT NULL,
|
||||
created_at timestamp without time zone,
|
||||
updated_at timestamp without time zone,
|
||||
currency character varying,
|
||||
|
@ -394,7 +394,7 @@ CREATE TABLE bank_transactions (
|
|||
buyer_name character varying,
|
||||
document_no character varying,
|
||||
description character varying,
|
||||
sum numeric(10,2),
|
||||
sum numeric(8,2),
|
||||
reference_no character varying,
|
||||
paid_at timestamp without time zone,
|
||||
created_at timestamp without time zone,
|
||||
|
@ -435,7 +435,7 @@ CREATE TABLE banklink_transactions (
|
|||
vk_rec_id character varying,
|
||||
vk_stamp character varying,
|
||||
vk_t_no character varying,
|
||||
vk_amount numeric(10,2),
|
||||
vk_amount numeric(8,2),
|
||||
vk_curr character varying,
|
||||
vk_rec_acc character varying,
|
||||
vk_rec_name character varying,
|
||||
|
@ -472,6 +472,39 @@ CREATE SEQUENCE banklink_transactions_id_seq
|
|||
ALTER SEQUENCE banklink_transactions_id_seq OWNED BY banklink_transactions.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
CREATE TABLE blocked_domains (
|
||||
id integer NOT NULL,
|
||||
names character varying[],
|
||||
created_at timestamp without time zone,
|
||||
updated_at timestamp without time zone,
|
||||
creator_str character varying,
|
||||
updator_str character varying
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: blocked_domains_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE blocked_domains_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: blocked_domains_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE blocked_domains_id_seq OWNED BY blocked_domains.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: cached_nameservers; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -639,6 +672,15 @@ CREATE SEQUENCE countries_id_seq
|
|||
ALTER SEQUENCE countries_id_seq OWNED BY countries.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: data_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
CREATE TABLE data_migrations (
|
||||
version character varying NOT NULL
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: delegation_signers; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -951,7 +993,7 @@ CREATE TABLE invoice_items (
|
|||
description character varying NOT NULL,
|
||||
unit character varying,
|
||||
amount integer,
|
||||
price numeric(10,2),
|
||||
price numeric(8,2),
|
||||
created_at timestamp without time zone,
|
||||
updated_at timestamp without time zone,
|
||||
creator_str character varying,
|
||||
|
@ -992,7 +1034,7 @@ CREATE TABLE invoices (
|
|||
currency character varying NOT NULL,
|
||||
description character varying,
|
||||
reference_no character varying,
|
||||
vat_prc numeric(10,2) NOT NULL,
|
||||
vat_prc numeric(8,2) NOT NULL,
|
||||
paid_at timestamp without time zone,
|
||||
seller_id integer,
|
||||
seller_name character varying NOT NULL,
|
||||
|
@ -1025,7 +1067,7 @@ CREATE TABLE invoices (
|
|||
updator_str character varying,
|
||||
number integer,
|
||||
cancelled_at timestamp without time zone,
|
||||
sum_cache numeric(10,2)
|
||||
sum_cache numeric(8,2)
|
||||
);
|
||||
|
||||
|
||||
|
@ -1349,6 +1391,43 @@ CREATE SEQUENCE log_bank_transactions_id_seq
|
|||
ALTER SEQUENCE log_bank_transactions_id_seq OWNED BY log_bank_transactions.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_blocked_domains; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
CREATE TABLE log_blocked_domains (
|
||||
id integer NOT NULL,
|
||||
item_type character varying NOT NULL,
|
||||
item_id integer NOT NULL,
|
||||
event character varying NOT NULL,
|
||||
whodunnit character varying,
|
||||
object json,
|
||||
object_changes json,
|
||||
created_at timestamp without time zone,
|
||||
session character varying,
|
||||
children json
|
||||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_blocked_domains_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE log_blocked_domains_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_blocked_domains_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE log_blocked_domains_id_seq OWNED BY log_blocked_domains.id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_certificates; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -2287,7 +2366,7 @@ CREATE TABLE pricelists (
|
|||
id integer NOT NULL,
|
||||
"desc" character varying,
|
||||
category character varying,
|
||||
price_cents numeric(8,2) DEFAULT 0 NOT NULL,
|
||||
price_cents numeric(8,2) DEFAULT 0.0 NOT NULL,
|
||||
price_currency character varying DEFAULT 'EUR'::character varying NOT NULL,
|
||||
valid_from timestamp without time zone,
|
||||
valid_to timestamp without time zone,
|
||||
|
@ -2325,8 +2404,8 @@ ALTER SEQUENCE pricelists_id_seq OWNED BY pricelists.id;
|
|||
|
||||
CREATE TABLE que_jobs (
|
||||
priority smallint DEFAULT 100 NOT NULL,
|
||||
run_at timestamp with time zone DEFAULT now() NOT NULL,
|
||||
job_id bigint NOT NULL,
|
||||
run_at timestamp without time zone DEFAULT '2015-06-30 14:16:49.190473'::timestamp without time zone NOT NULL,
|
||||
job_id bigint DEFAULT 0 NOT NULL,
|
||||
job_class text NOT NULL,
|
||||
args json DEFAULT '[]'::json NOT NULL,
|
||||
error_count integer DEFAULT 0 NOT NULL,
|
||||
|
@ -2335,32 +2414,6 @@ CREATE TABLE que_jobs (
|
|||
);
|
||||
|
||||
|
||||
--
|
||||
-- Name: TABLE que_jobs; Type: COMMENT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
COMMENT ON TABLE que_jobs IS '3';
|
||||
|
||||
|
||||
--
|
||||
-- Name: que_jobs_job_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
CREATE SEQUENCE que_jobs_job_id_seq
|
||||
START WITH 1
|
||||
INCREMENT BY 1
|
||||
NO MINVALUE
|
||||
NO MAXVALUE
|
||||
CACHE 1;
|
||||
|
||||
|
||||
--
|
||||
-- Name: que_jobs_job_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER SEQUENCE que_jobs_job_id_seq OWNED BY que_jobs.job_id;
|
||||
|
||||
|
||||
--
|
||||
-- Name: registrant_verifications; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -2551,7 +2604,7 @@ CREATE TABLE users (
|
|||
crt text,
|
||||
type character varying,
|
||||
registrant_ident character varying,
|
||||
encrypted_password character varying DEFAULT ''::character varying,
|
||||
encrypted_password character varying DEFAULT ''::character varying NOT NULL,
|
||||
remember_created_at timestamp without time zone,
|
||||
failed_attempts integer DEFAULT 0 NOT NULL,
|
||||
locked_at timestamp without time zone
|
||||
|
@ -2766,6 +2819,13 @@ ALTER TABLE ONLY bank_transactions ALTER COLUMN id SET DEFAULT nextval('bank_tra
|
|||
ALTER TABLE ONLY banklink_transactions ALTER COLUMN id SET DEFAULT nextval('banklink_transactions_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY blocked_domains ALTER COLUMN id SET DEFAULT nextval('blocked_domains_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -2920,6 +2980,13 @@ ALTER TABLE ONLY log_bank_statements ALTER COLUMN id SET DEFAULT nextval('log_ba
|
|||
ALTER TABLE ONLY log_bank_transactions ALTER COLUMN id SET DEFAULT nextval('log_bank_transactions_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY log_blocked_domains ALTER COLUMN id SET DEFAULT nextval('log_blocked_domains_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -3102,13 +3169,6 @@ ALTER TABLE ONLY people ALTER COLUMN id SET DEFAULT nextval('people_id_seq'::reg
|
|||
ALTER TABLE ONLY pricelists ALTER COLUMN id SET DEFAULT nextval('pricelists_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: job_id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY que_jobs ALTER COLUMN job_id SET DEFAULT nextval('que_jobs_job_id_seq'::regclass);
|
||||
|
||||
|
||||
--
|
||||
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -3228,6 +3288,14 @@ ALTER TABLE ONLY banklink_transactions
|
|||
ADD CONSTRAINT banklink_transactions_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY blocked_domains
|
||||
ADD CONSTRAINT blocked_domains_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -3404,6 +3472,14 @@ ALTER TABLE ONLY log_bank_transactions
|
|||
ADD CONSTRAINT log_bank_transactions_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_blocked_domains_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY log_blocked_domains
|
||||
ADD CONSTRAINT log_blocked_domains_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: log_certificates_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -3612,14 +3688,6 @@ ALTER TABLE ONLY pricelists
|
|||
ADD CONSTRAINT pricelists_pkey PRIMARY KEY (id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: que_jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY que_jobs
|
||||
ADD CONSTRAINT que_jobs_pkey PRIMARY KEY (queue, priority, run_at, job_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: registrant_verifications_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -4014,6 +4082,20 @@ CREATE INDEX index_log_bank_transactions_on_item_type_and_item_id ON log_bank_tr
|
|||
CREATE INDEX index_log_bank_transactions_on_whodunnit ON log_bank_transactions USING btree (whodunnit);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_log_blocked_domains_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
CREATE INDEX index_log_blocked_domains_on_item_type_and_item_id ON log_blocked_domains USING btree (item_type, item_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_log_blocked_domains_on_whodunnit; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
CREATE INDEX index_log_blocked_domains_on_whodunnit ON log_blocked_domains USING btree (whodunnit);
|
||||
|
||||
|
||||
--
|
||||
-- Name: index_log_certificates_on_item_type_and_item_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -4378,6 +4460,13 @@ CREATE INDEX index_whois_records_on_domain_id ON whois_records USING btree (doma
|
|||
CREATE INDEX index_whois_records_on_registrar_id ON whois_records USING btree (registrar_id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: unique_data_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
||||
CREATE UNIQUE INDEX unique_data_migrations ON data_migrations USING btree (version);
|
||||
|
||||
|
||||
--
|
||||
-- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
||||
--
|
||||
|
@ -4593,8 +4682,6 @@ INSERT INTO schema_migrations (version) VALUES ('20150227092508');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150227113121');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150302130224');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150302161712');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150303130729');
|
||||
|
@ -4653,8 +4740,6 @@ INSERT INTO schema_migrations (version) VALUES ('20150417082723');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150421134820');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150422090645');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150422092514');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150422132631');
|
||||
|
@ -4699,8 +4784,6 @@ INSERT INTO schema_migrations (version) VALUES ('20150519115050');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150519140853');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150519142542');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150519144118');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150520163237');
|
||||
|
@ -4713,7 +4796,9 @@ INSERT INTO schema_migrations (version) VALUES ('20150522164020');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150525075550');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150603141054');
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150601083516');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150601083800');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150603141549');
|
||||
|
||||
|
@ -4721,8 +4806,12 @@ INSERT INTO schema_migrations (version) VALUES ('20150603211318');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150603212659');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150609093515');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150609103333');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150610111019');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150610112238');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150610144547');
|
||||
|
@ -4731,3 +4820,7 @@ INSERT INTO schema_migrations (version) VALUES ('20150611124920');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150612123111');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150612125720');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20150701074344');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue