"Support UTF-8 + gestion de base des kits"
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
\c postgres;
|
||||
|
||||
drop database tetalab_stock;
|
||||
create database tetalab_stock;
|
||||
drop database tetastock;
|
||||
drop role tetastock;
|
||||
|
||||
\c tetalab_stock;
|
||||
create role tetastock with LOGIN ENCRYPTED PASSWORD 'tetastock';
|
||||
|
||||
create database tetastock;
|
||||
|
||||
\c tetastock;
|
||||
|
||||
CREATE TABLE stock_users (
|
||||
id serial primary key,
|
||||
@@ -14,8 +18,8 @@ CREATE TABLE stock_users (
|
||||
|
||||
CREATE TABLE stock_kits (
|
||||
id serial primary key,
|
||||
name text not NULL,
|
||||
description text not NULL
|
||||
name text not NULL unique,
|
||||
designation text not NULL
|
||||
);
|
||||
|
||||
CREATE TABLE stock_providers (
|
||||
@@ -46,12 +50,26 @@ CREATE TABLE stock_kit_compositions (
|
||||
quantity integer not NULL
|
||||
);
|
||||
|
||||
alter table stock_users owner to tetalab_user;
|
||||
alter table stock_kits owner to tetalab_user;
|
||||
alter table stock_providers owner to tetalab_user;
|
||||
alter table stock_componants owner to tetalab_user;
|
||||
alter table stock_kit_compositions owner to tetalab_user;
|
||||
alter database tetalab_stock owner to tetalab_user;
|
||||
CREATE TABLE stock_orders (
|
||||
id serial primary key,
|
||||
componant_id integer REFERENCES stock_componants(id),
|
||||
quantity integer not NULL,
|
||||
price NUMERIC not NULL default 0,
|
||||
date timestamp not NULL
|
||||
);
|
||||
|
||||
alter table stock_users owner to tetastock;
|
||||
alter table stock_kits owner to tetastock;
|
||||
alter table stock_providers owner to tetastock;
|
||||
alter table stock_componants owner to tetastock;
|
||||
alter table stock_kit_compositions owner to tetastock;
|
||||
alter table stock_orders owner to tetastock;
|
||||
alter database tetastock owner to tetastock;
|
||||
|
||||
insert into stock_users (mail, password, name) values
|
||||
('doug.letough@free.fr', '$2a$08$578910202124252729313uTyggq4ANEjMljcClFriOqcsttB2fnAW', 'Doug Le Tough');
|
||||
insert into stock_users (mail, password, name) values
|
||||
('doug@redatomik.org', '$2a$08$578910202124252729313uTyggq4ANEjMljcClFriOqcsttB2fnAW', 'Doug Le Tough');
|
||||
|
||||
insert into stock_providers (name, address, mail, url, comment)
|
||||
values ('Tous', 'N/A', 'N/A', 'N/A', 'N/A');
|
||||
|
||||
Reference in New Issue
Block a user