Project

General

Profile

« Previous | Next » 

Revision 57212

simple authentication

View differences:

schema.sql
1 1
DROP VIEW organizations_view;
2 2
DROP VIEW organizations_simple_view;
3 3

  
4
DROP TABLE IF EXISTS user_countries;
5
DROP TABLE IF EXISTS users;
4 6
DROP TABLE IF EXISTS other_ids;
5 7
DROP TABLE IF EXISTS other_names;
6 8
DROP TABLE IF EXISTS acronyms;
......
14 16
DROP TABLE IF EXISTS languages;
15 17
DROP TABLE IF EXISTS countries;
16 18

  
19

  
17 20
CREATE TABLE org_types (val text PRIMARY KEY);
18 21
INSERT INTO org_types VALUES ('Archive'), ('Company'), ('Education'), ('Facility'), ('Government'), ('Healthcare'), ('Nonprofit'), ('Other');
19 22

  
......
39 42
			('SK'), ('SL'), ('SM'), ('SN'), ('SO'), ('SR'), ('SS'), ('ST'), ('SV'), ('SX'), ('SY'), ('SZ'), ('TC'), ('TD'), ('TG'), ('TH'), ('TJ'), ('TL'), ('TM'), ('TN'), ('TO'), ('TR'),
40 43
			('TT'), ('TV'), ('TW'), ('TZ'), ('UA'), ('UG'), ('US'), ('UY'), ('UZ'), ('VA'), ('VC'), ('VE'), ('VG'), ('VN'), ('WS'), ('XK'), ('YE'), ('ZA'), ('ZM'), ('ZW');
41 44

  
45
CREATE TABLE users (
46
	email     text PRIMARY KEY,
47
	password  text NOT NULL,
48
	valid     boolean default true,
49
	superuser boolean default false
50
);
42 51

  
52
CREATE TABLE user_countries (
53
	email     text REFERENCES users(email),
54
	country   text  REFERENCES countries(val),
55
	PRIMARY KEY(email, country)	
56
);
57

  
43 58
CREATE TABLE organizations (
44 59
    id                text PRIMARY KEY,
45 60
    name              text,

Also available in: Unified diff