Fix unique foreign key in view (#1395)
This commit is contained in:
Vendored
+8
@@ -512,3 +512,11 @@ TRUNCATE TABLE app_users CASCADE;
|
||||
INSERT INTO app_users (id, email, "password") VALUES (1, 'test@123.com','pass');
|
||||
INSERT INTO app_users (id, email, "password") VALUES (2, 'abc@123.com','pass');
|
||||
INSERT INTO app_users (id, email, "password") VALUES (3, 'def@123.com','pass');
|
||||
|
||||
TRUNCATE TABLE private.pages CASCADE;
|
||||
INSERT INTO private.pages VALUES (1, 'http://postgrest.org/en/v6.0/api.html');
|
||||
INSERT INTO private.pages VALUES (2, 'http://postgrest.org/en/v6.0/admin.html');
|
||||
|
||||
TRUNCATE TABLE private.referrals CASCADE;
|
||||
INSERT INTO private.referrals VALUES ('github.com', 1);
|
||||
INSERT INTO private.referrals VALUES ('hub.docker.com', 2);
|
||||
|
||||
Vendored
+2
@@ -104,6 +104,8 @@ GRANT ALL ON TABLE
|
||||
, getallprojects_view
|
||||
, get_projects_above_view
|
||||
, web_content
|
||||
, pages
|
||||
, referrals
|
||||
TO postgrest_test_anonymous;
|
||||
|
||||
GRANT INSERT ON TABLE insertonly TO postgrest_test_anonymous;
|
||||
|
||||
Vendored
+14
@@ -1759,3 +1759,17 @@ create table app_users (
|
||||
email text unique not null,
|
||||
password text not null
|
||||
);
|
||||
|
||||
create table private.pages (
|
||||
link int not null unique
|
||||
, url text
|
||||
);
|
||||
|
||||
create table private.referrals (
|
||||
site text
|
||||
, link int references private.pages(link) not null
|
||||
);
|
||||
|
||||
create view test.pages as select * from private.pages;
|
||||
|
||||
create view test.referrals as select * from private.referrals;
|
||||
|
||||
Reference in New Issue
Block a user