File: init_database.sql

package info (click to toggle)
indigo 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 48,936 kB
  • sloc: ansic: 332,816; cpp: 169,470; python: 20,033; java: 13,701; cs: 9,979; asm: 8,475; sql: 6,743; xml: 6,354; javascript: 1,245; sh: 555; php: 506; makefile: 54
file content (30 lines) | stat: -rw-r--r-- 1,118 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- indigoservice user
create user indigoservice with password 'p@ssw0rd';
create schema indigoservice authorization indigoservice;
grant all on table pg_depend to indigoservice;
grant usage on schema bingo to indigoservice;
grant select on table bingo.bingo_config to indigoservice;
grant select on table bingo.bingo_tau_config to indigoservice;

-- data schema
create table indigoservice.library_metadata(
    library_id varchar(36) primary key,
    service_data jsonb,
    user_data jsonb,
    index_data jsonb);
grant all on table indigoservice.library_metadata to indigoservice;

create table indigoservice.users(
    user_id serial primary key,
    username varchar(50) not null,
    password varchar(100) not null,
    email varchar(100) not null,
    foreign_auth_provider varchar(10),
    foreign_auth_id integer,
    user_created timestamp default now());
grant all on table indigoservice.users to indigoservice;
grant all on sequence indigoservice.users_user_id_seq to indigoservice;

-- upload testing schema
drop schema if exists test_upload cascade;
create schema test_upload authorization indigoservice;