瀏覽代碼

dev en cours

rajah 8 月之前
父節點
當前提交
a96ef74959
共有 4 個文件被更改,包括 0 次插入34 次删除
  1. 0 2
      postgresql/base.sql
  2. 0 19
      postgresql/tables/privileges.sql
  3. 0 1
      postgresql/tables/roles.sql
  4. 0 12
      postgresql/tables/roles_privileges.sql

+ 0 - 2
postgresql/base.sql

@@ -33,8 +33,6 @@ CREATE SCHEMA IF NOT EXISTS vote AUTHORIZATION vote;
 \ir ./tables/variables.sql
 \ir ./tables/evenements.sql
 \ir ./tables/roles.sql
-\ir ./tables/privileges.sql
-\ir ./tables/roles_privileges.sql
 \ir ./tables/participants.sql
 \ir ./tables/participants_roles.sql
 \ir ./tables/messages.sql

+ 0 - 19
postgresql/tables/privileges.sql

@@ -1,19 +0,0 @@
-CREATE TABLE IF NOT EXISTS vote.privileges
-(
-    date_creation timestamp without time zone NOT NULL DEFAULT now(),
-    date_modification timestamp without time zone,
-    numero_privilege integer NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
-    libelle character varying(128) COLLATE pg_catalog."default" NOT NULL
-)
-TABLESPACE vote;
-ALTER TABLE IF EXISTS vote.privileges OWNER to vote;
-
-CREATE FUNCTION vote.dateModificationPrivilege() RETURNS TRIGGER AS $$
-BEGIN
-  NEW.date_modification = now();
-  return NEW;
-END;
-$$ LANGUAGE 'plpgsql';
-ALTER FUNCTION vote.dateModificationPrivilege() OWNER TO vote;
-
-CREATE OR REPLACE TRIGGER dateModificationPrivilege BEFORE UPDATE ON vote.privileges FOR EACH ROW EXECUTE FUNCTION vote.dateModificationPrivilege();

+ 0 - 1
postgresql/tables/roles.sql

@@ -3,7 +3,6 @@ CREATE TABLE IF NOT EXISTS vote.roles
     date_creation timestamp without time zone NOT NULL DEFAULT now(),
     date_modification timestamp without time zone,
     numero_role integer NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
-    flag_actif boolean DEFAULT true,
     libelle character varying(64) COLLATE pg_catalog."default" NOT NULL
 )
 TABLESPACE vote;

+ 0 - 12
postgresql/tables/roles_privileges.sql

@@ -1,12 +0,0 @@
-CREATE TABLE IF NOT EXISTS vote.roles_privileges
-(
-    numero_privilege integer NOT NULL,
-    numero_role integer NOT NULL,
-    CONSTRAINT fk_numeroPrivilegeRole FOREIGN KEY(numero_privilege) REFERENCES vote.privileges(numero_privilege),
-    CONSTRAINT fk_numeroRolePrivilege FOREIGN KEY(numero_role) REFERENCES vote.roles(numero_role)
-)
-TABLESPACE vote;
-ALTER TABLE IF EXISTS vote.roles_privileges OWNER to vote;
-
-CREATE INDEX IF NOT EXISTS ix_numeroPrivilegeRole ON vote.roles_privileges USING btree (numero_privilege) TABLESPACE vote;
-CREATE INDEX IF NOT EXISTS ix_numeroRolePrivilege ON vote.roles_privileges USING btree (numero_role) TABLESPACE vote;