nineskeletor/migrations/Version20230201080252.php
afornerot 9554b9cdd3
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit
ninegate
2023-02-01 09:03:27 +01:00

299 lines
32 KiB
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230201080252 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SEQUENCE alert_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE alertcategory_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE audit_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE bookmark_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE cron_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE groupe_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE icon_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE item_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE itemcategory_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE niveau01_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE niveau02_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE niveau03_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE niveau04_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE page_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE pagecategory_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE pagewidget_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE pagewidgetslide_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE registration_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE useraccount_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE usergroupe_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE usermodo_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE whitelist_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE widget_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE alert (id INT NOT NULL, category INT NOT NULL, title VARCHAR(100) NOT NULL, content TEXT DEFAULT NULL, rowOrder INT DEFAULT NULL, publishedat DATE NOT NULL, unpublishedat DATE DEFAULT NULL, fghideable BOOLEAN NOT NULL, roles TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_17FD46C164C19C1 ON alert (category)');
$this->addSql('COMMENT ON COLUMN alert.roles IS \'(DC2Type:array)\'');
$this->addSql('CREATE TABLE alertgroupe (alert INT NOT NULL, groupe INT NOT NULL, PRIMARY KEY(alert, groupe))');
$this->addSql('CREATE INDEX IDX_64DB975617FD46C1 ON alertgroupe (alert)');
$this->addSql('CREATE INDEX IDX_64DB97564B98C21 ON alertgroupe (groupe)');
$this->addSql('CREATE TABLE alertuserread (alert INT NOT NULL, useraccount INT NOT NULL, PRIMARY KEY(alert, useraccount))');
$this->addSql('CREATE INDEX IDX_D4317FA917FD46C1 ON alertuserread (alert)');
$this->addSql('CREATE INDEX IDX_D4317FA9E157AA1A ON alertuserread (useraccount)');
$this->addSql('CREATE TABLE alertcategory (id INT NOT NULL, icon_id INT DEFAULT NULL, label VARCHAR(100) NOT NULL, color VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_EC575F7E54B9D732 ON alertcategory (icon_id)');
$this->addSql('CREATE TABLE audit (id INT NOT NULL, entityname VARCHAR(250) NOT NULL, entityid VARCHAR(250) NOT NULL, datesubmit TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, username VARCHAR(250) NOT NULL, description TEXT DEFAULT NULL, detail TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX search_idx ON audit (entityname, entityid, datesubmit)');
$this->addSql('COMMENT ON COLUMN audit.detail IS \'(DC2Type:array)\'');
$this->addSql('CREATE TABLE bookmark (id INT NOT NULL, icon_id INT DEFAULT NULL, user_id INT DEFAULT NULL, pagewidget_id INT DEFAULT NULL, item_id INT DEFAULT NULL, title VARCHAR(100) NOT NULL, subtitle VARCHAR(250) DEFAULT NULL, url VARCHAR(500) NOT NULL, target VARCHAR(32) NOT NULL, rowOrder INT DEFAULT NULL, color VARCHAR(24) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_DA62921D54B9D732 ON bookmark (icon_id)');
$this->addSql('CREATE INDEX IDX_DA62921DA76ED395 ON bookmark (user_id)');
$this->addSql('CREATE INDEX IDX_DA62921D55B7C7A2 ON bookmark (pagewidget_id)');
$this->addSql('CREATE INDEX IDX_DA62921D126F525E ON bookmark (item_id)');
$this->addSql('CREATE TABLE config (id VARCHAR(255) NOT NULL, title VARCHAR(250) NOT NULL, value TEXT DEFAULT NULL, defaultvalue TEXT NOT NULL, roworder VARCHAR(255) NOT NULL, visible BOOLEAN NOT NULL, changeable BOOLEAN NOT NULL, required BOOLEAN NOT NULL, type VARCHAR(255) NOT NULL, grouped VARCHAR(255) NOT NULL, category VARCHAR(255) NOT NULL, help TEXT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE cron (id INT NOT NULL, command VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, statut INT DEFAULT NULL, submitdate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, startexecdate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, endexecdate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, nextexecdate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, repeatinterval INT DEFAULT NULL, jsonargument TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE groupe (id INT NOT NULL, owner_id INT DEFAULT NULL, pagetemplate_id INT DEFAULT NULL, label VARCHAR(250) NOT NULL, description TEXT DEFAULT NULL, email VARCHAR(250) DEFAULT NULL, isopen BOOLEAN DEFAULT false NOT NULL, isworkgroup BOOLEAN DEFAULT false NOT NULL, apikey VARCHAR(255) NOT NULL, ldapfilter TEXT DEFAULT NULL, attributes TEXT DEFAULT NULL, idexternal TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_4B98C21EA750E8 ON groupe (label)');
$this->addSql('CREATE INDEX IDX_4B98C217E3C61F9 ON groupe (owner_id)');
$this->addSql('CREATE INDEX IDX_4B98C216D71CE5E ON groupe (pagetemplate_id)');
$this->addSql('CREATE TABLE icon (id INT NOT NULL, user_id INT DEFAULT NULL, label VARCHAR(250) NOT NULL, tags VARCHAR(250) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_659429DBEA750E8 ON icon (label)');
$this->addSql('CREATE INDEX IDX_659429DBA76ED395 ON icon (user_id)');
$this->addSql('CREATE TABLE item (id INT NOT NULL, icon_id INT DEFAULT NULL, category INT NOT NULL, title VARCHAR(100) NOT NULL, subtitle VARCHAR(250) DEFAULT NULL, slug VARCHAR(128) DEFAULT NULL, url VARCHAR(500) NOT NULL, target VARCHAR(32) NOT NULL, content TEXT DEFAULT NULL, rowOrder INT DEFAULT NULL, essential BOOLEAN DEFAULT false, protected BOOLEAN DEFAULT false, color VARCHAR(24) DEFAULT NULL, roles TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1F1B251E989D9B62 ON item (slug)');
$this->addSql('CREATE INDEX IDX_1F1B251E54B9D732 ON item (icon_id)');
$this->addSql('CREATE INDEX IDX_1F1B251E64C19C1 ON item (category)');
$this->addSql('COMMENT ON COLUMN item.roles IS \'(DC2Type:array)\'');
$this->addSql('CREATE TABLE itemgroupe (item INT NOT NULL, groupe INT NOT NULL, PRIMARY KEY(item, groupe))');
$this->addSql('CREATE INDEX IDX_A4267B6D1F1B251E ON itemgroupe (item)');
$this->addSql('CREATE INDEX IDX_A4267B6D4B98C21 ON itemgroupe (groupe)');
$this->addSql('CREATE TABLE itemcategory (id INT NOT NULL, icon_id INT DEFAULT NULL, label VARCHAR(100) NOT NULL, color VARCHAR(24) DEFAULT NULL, rowOrder INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_7959DEE854B9D732 ON itemcategory (icon_id)');
$this->addSql('CREATE TABLE niveau01 (id INT NOT NULL, label VARCHAR(250) NOT NULL, code TEXT DEFAULT NULL, postaladress TEXT DEFAULT NULL, telephonenumber VARCHAR(60) DEFAULT NULL, email VARCHAR(60) DEFAULT NULL, apikey VARCHAR(255) NOT NULL, ldapfilter TEXT DEFAULT NULL, attributes TEXT DEFAULT NULL, idexternal TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6DFC7E23EA750E8 ON niveau01 (label)');
$this->addSql('CREATE TABLE niveau02 (id INT NOT NULL, niveau01_id INT NOT NULL, label VARCHAR(250) NOT NULL, code TEXT DEFAULT NULL, postaladress TEXT DEFAULT NULL, telephonenumber VARCHAR(60) DEFAULT NULL, email VARCHAR(60) DEFAULT NULL, apikey VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_F4F52F99EA750E8 ON niveau02 (label)');
$this->addSql('CREATE INDEX IDX_F4F52F9959FDD7AB ON niveau02 (niveau01_id)');
$this->addSql('CREATE TABLE niveau03 (id INT NOT NULL, niveau02_id INT NOT NULL, label VARCHAR(250) NOT NULL, code TEXT DEFAULT NULL, postaladress TEXT DEFAULT NULL, telephonenumber VARCHAR(60) DEFAULT NULL, email VARCHAR(60) DEFAULT NULL, apikey VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_83F21F0FEA750E8 ON niveau03 (label)');
$this->addSql('CREATE INDEX IDX_83F21F0F4B487845 ON niveau03 (niveau02_id)');
$this->addSql('CREATE TABLE niveau04 (id INT NOT NULL, niveau03_id INT NOT NULL, label VARCHAR(250) NOT NULL, code TEXT DEFAULT NULL, postaladress TEXT DEFAULT NULL, telephonenumber VARCHAR(60) DEFAULT NULL, email VARCHAR(60) DEFAULT NULL, apikey VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1D968AACEA750E8 ON niveau04 (label)');
$this->addSql('CREATE INDEX IDX_1D968AACF3F41F20 ON niveau04 (niveau03_id)');
$this->addSql('CREATE TABLE page (id INT NOT NULL, pagecategory_id INT DEFAULT NULL, user_id INT DEFAULT NULL, page_id INT DEFAULT NULL, name VARCHAR(100) NOT NULL, roworder INT NOT NULL, maxwidth INT NOT NULL, fonticon VARCHAR(255) DEFAULT NULL, url TEXT DEFAULT NULL, toreload BOOLEAN DEFAULT NULL, html TEXT DEFAULT NULL, template TEXT DEFAULT NULL, parentfor VARCHAR(255) DEFAULT NULL, roles TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_140AB6207AED5C04 ON page (pagecategory_id)');
$this->addSql('CREATE INDEX IDX_140AB620A76ED395 ON page (user_id)');
$this->addSql('CREATE INDEX IDX_140AB620C4663E4 ON page (page_id)');
$this->addSql('COMMENT ON COLUMN page.template IS \'(DC2Type:array)\'');
$this->addSql('COMMENT ON COLUMN page.roles IS \'(DC2Type:array)\'');
$this->addSql('CREATE TABLE pagegroupe (page INT NOT NULL, groupe INT NOT NULL, PRIMARY KEY(page, groupe))');
$this->addSql('CREATE INDEX IDX_E8009F6B140AB620 ON pagegroupe (page)');
$this->addSql('CREATE INDEX IDX_E8009F6B4B98C21 ON pagegroupe (groupe)');
$this->addSql('CREATE TABLE pagecategory (id INT NOT NULL, name VARCHAR(100) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE pagewidget (id INT NOT NULL, page_id INT DEFAULT NULL, widget_id INT DEFAULT NULL, icon_id INT DEFAULT NULL, name VARCHAR(100) NOT NULL, loc VARCHAR(255) NOT NULL, roworder INT NOT NULL, height INT NOT NULL, autoajust BOOLEAN DEFAULT false NOT NULL, border BOOLEAN DEFAULT true NOT NULL, opened BOOLEAN DEFAULT true NOT NULL, viewheader BOOLEAN DEFAULT true NOT NULL, colorheaderback VARCHAR(255) DEFAULT NULL, colorheaderfont VARCHAR(255) DEFAULT NULL, colorbodyback VARCHAR(255) DEFAULT NULL, colorbodyfont VARCHAR(255) DEFAULT NULL, parameter TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_69400D9AC4663E4 ON pagewidget (page_id)');
$this->addSql('CREATE INDEX IDX_69400D9AFBE885E2 ON pagewidget (widget_id)');
$this->addSql('CREATE INDEX IDX_69400D9A54B9D732 ON pagewidget (icon_id)');
$this->addSql('COMMENT ON COLUMN pagewidget.parameter IS \'(DC2Type:array)\'');
$this->addSql('CREATE TABLE pagewidgetslide (id INT NOT NULL, pagewidget_id INT DEFAULT NULL, title VARCHAR(100) DEFAULT NULL, subtitle VARCHAR(250) DEFAULT NULL, url VARCHAR(500) DEFAULT NULL, target VARCHAR(32) NOT NULL, roworder INT DEFAULT NULL, image VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_DF96542055B7C7A2 ON pagewidgetslide (pagewidget_id)');
$this->addSql('CREATE TABLE registration (id INT NOT NULL, niveau01_id INT NOT NULL, niveau02_id INT DEFAULT NULL, niveau03_id INT DEFAULT NULL, niveau04_id INT DEFAULT NULL, username VARCHAR(128) NOT NULL, firstname VARCHAR(250) DEFAULT NULL, lastname VARCHAR(250) DEFAULT NULL, password VARCHAR(250) NOT NULL, salt VARCHAR(250) NOT NULL, email VARCHAR(128) NOT NULL, isvisible BOOLEAN NOT NULL, postaladress VARCHAR(250) DEFAULT NULL, telephonenumber VARCHAR(60) DEFAULT NULL, job VARCHAR(250) DEFAULT NULL, position VARCHAR(250) DEFAULT NULL, motivation TEXT DEFAULT NULL, note TEXT DEFAULT NULL, keyexpire TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, keyvalue VARCHAR(60) DEFAULT NULL, statut INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_62A8A7A7F85E0677 ON registration (username)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_62A8A7A7E7927C74 ON registration (email)');
$this->addSql('CREATE INDEX IDX_62A8A7A759FDD7AB ON registration (niveau01_id)');
$this->addSql('CREATE INDEX IDX_62A8A7A74B487845 ON registration (niveau02_id)');
$this->addSql('CREATE INDEX IDX_62A8A7A7F3F41F20 ON registration (niveau03_id)');
$this->addSql('CREATE INDEX IDX_62A8A7A76E232799 ON registration (niveau04_id)');
$this->addSql('CREATE TABLE useraccount (id INT NOT NULL, niveau01_id INT NOT NULL, niveau02_id INT DEFAULT NULL, niveau03_id INT DEFAULT NULL, niveau04_id INT DEFAULT NULL, username VARCHAR(128) NOT NULL, apikey VARCHAR(255) NOT NULL, firstname VARCHAR(250) DEFAULT NULL, lastname VARCHAR(250) DEFAULT NULL, roles TEXT NOT NULL, password VARCHAR(250) NOT NULL, salt VARCHAR(250) NOT NULL, isactive BOOLEAN NOT NULL, email VARCHAR(128) NOT NULL, avatar VARCHAR(250) DEFAULT \'0\', isvisible BOOLEAN NOT NULL, postaladress TEXT DEFAULT NULL, telephonenumber VARCHAR(60) DEFAULT NULL, job VARCHAR(250) DEFAULT NULL, position VARCHAR(250) DEFAULT NULL, motivation TEXT DEFAULT NULL, note TEXT DEFAULT NULL, preference TEXT DEFAULT NULL, keyexpire TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, keyvalue VARCHAR(60) DEFAULT NULL, visitedate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, visitecpt INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_E157AA1AF85E0677 ON useraccount (username)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_E157AA1AE7927C74 ON useraccount (email)');
$this->addSql('CREATE INDEX IDX_E157AA1A59FDD7AB ON useraccount (niveau01_id)');
$this->addSql('CREATE INDEX IDX_E157AA1A4B487845 ON useraccount (niveau02_id)');
$this->addSql('CREATE INDEX IDX_E157AA1AF3F41F20 ON useraccount (niveau03_id)');
$this->addSql('CREATE INDEX IDX_E157AA1A6E232799 ON useraccount (niveau04_id)');
$this->addSql('COMMENT ON COLUMN useraccount.roles IS \'(DC2Type:array)\'');
$this->addSql('COMMENT ON COLUMN useraccount.preference IS \'(DC2Type:array)\'');
$this->addSql('CREATE TABLE usergroupe (id INT NOT NULL, user_id INT DEFAULT NULL, group_id INT DEFAULT NULL, rolegroup INT NOT NULL, apikey VARCHAR(60) NOT NULL, visitedate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, visitecpt INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_6C439BE5A76ED395 ON usergroupe (user_id)');
$this->addSql('CREATE INDEX IDX_6C439BE5FE54D947 ON usergroupe (group_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_6C439BE5A76ED395FE54D947 ON usergroupe (user_id, group_id)');
$this->addSql('CREATE TABLE usermodo (id INT NOT NULL, user_id INT NOT NULL, niveau01_id INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_D162D6C4A76ED395 ON usermodo (user_id)');
$this->addSql('CREATE INDEX IDX_D162D6C459FDD7AB ON usermodo (niveau01_id)');
$this->addSql('CREATE TABLE whitelist (id INT NOT NULL, label VARCHAR(250) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_CB069864EA750E8 ON whitelist (label)');
$this->addSql('CREATE TABLE widget (id INT NOT NULL, icon_id INT DEFAULT NULL, roworder INT NOT NULL, name VARCHAR(100) NOT NULL, description TEXT DEFAULT NULL, routeview VARCHAR(255) NOT NULL, height INT NOT NULL, autoajust BOOLEAN DEFAULT false NOT NULL, border BOOLEAN DEFAULT true NOT NULL, opened BOOLEAN DEFAULT true NOT NULL, viewheader BOOLEAN DEFAULT true NOT NULL, colorheaderback VARCHAR(255) DEFAULT NULL, colorheaderfont VARCHAR(255) DEFAULT NULL, colorbodyback VARCHAR(255) DEFAULT NULL, colorbodyfont VARCHAR(255) DEFAULT NULL, access TEXT DEFAULT NULL, parameter TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_85F91ED054B9D732 ON widget (icon_id)');
$this->addSql('COMMENT ON COLUMN widget.access IS \'(DC2Type:array)\'');
$this->addSql('COMMENT ON COLUMN widget.parameter IS \'(DC2Type:array)\'');
$this->addSql('CREATE TABLE messenger_messages (id BIGSERIAL NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0 ON messenger_messages (queue_name)');
$this->addSql('CREATE INDEX IDX_75EA56E0E3BD61CE ON messenger_messages (available_at)');
$this->addSql('CREATE INDEX IDX_75EA56E016BA31DB ON messenger_messages (delivered_at)');
$this->addSql('CREATE OR REPLACE FUNCTION notify_messenger_messages() RETURNS TRIGGER AS $$
BEGIN
PERFORM pg_notify(\'messenger_messages\', NEW.queue_name::text);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;');
$this->addSql('DROP TRIGGER IF EXISTS notify_trigger ON messenger_messages;');
$this->addSql('CREATE TRIGGER notify_trigger AFTER INSERT OR UPDATE ON messenger_messages FOR EACH ROW EXECUTE PROCEDURE notify_messenger_messages();');
$this->addSql('ALTER TABLE alert ADD CONSTRAINT FK_17FD46C164C19C1 FOREIGN KEY (category) REFERENCES alertcategory (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE alertgroupe ADD CONSTRAINT FK_64DB975617FD46C1 FOREIGN KEY (alert) REFERENCES alert (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE alertgroupe ADD CONSTRAINT FK_64DB97564B98C21 FOREIGN KEY (groupe) REFERENCES groupe (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE alertuserread ADD CONSTRAINT FK_D4317FA917FD46C1 FOREIGN KEY (alert) REFERENCES alert (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE alertuserread ADD CONSTRAINT FK_D4317FA9E157AA1A FOREIGN KEY (useraccount) REFERENCES useraccount (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE alertcategory ADD CONSTRAINT FK_EC575F7E54B9D732 FOREIGN KEY (icon_id) REFERENCES icon (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE bookmark ADD CONSTRAINT FK_DA62921D54B9D732 FOREIGN KEY (icon_id) REFERENCES icon (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE bookmark ADD CONSTRAINT FK_DA62921DA76ED395 FOREIGN KEY (user_id) REFERENCES useraccount (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE bookmark ADD CONSTRAINT FK_DA62921D55B7C7A2 FOREIGN KEY (pagewidget_id) REFERENCES pagewidget (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE bookmark ADD CONSTRAINT FK_DA62921D126F525E FOREIGN KEY (item_id) REFERENCES item (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE groupe ADD CONSTRAINT FK_4B98C217E3C61F9 FOREIGN KEY (owner_id) REFERENCES useraccount (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE groupe ADD CONSTRAINT FK_4B98C216D71CE5E FOREIGN KEY (pagetemplate_id) REFERENCES page (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE icon ADD CONSTRAINT FK_659429DBA76ED395 FOREIGN KEY (user_id) REFERENCES useraccount (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251E54B9D732 FOREIGN KEY (icon_id) REFERENCES icon (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251E64C19C1 FOREIGN KEY (category) REFERENCES itemcategory (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE itemgroupe ADD CONSTRAINT FK_A4267B6D1F1B251E FOREIGN KEY (item) REFERENCES item (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE itemgroupe ADD CONSTRAINT FK_A4267B6D4B98C21 FOREIGN KEY (groupe) REFERENCES groupe (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE itemcategory ADD CONSTRAINT FK_7959DEE854B9D732 FOREIGN KEY (icon_id) REFERENCES icon (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE niveau02 ADD CONSTRAINT FK_F4F52F9959FDD7AB FOREIGN KEY (niveau01_id) REFERENCES niveau01 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE niveau03 ADD CONSTRAINT FK_83F21F0F4B487845 FOREIGN KEY (niveau02_id) REFERENCES niveau02 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE niveau04 ADD CONSTRAINT FK_1D968AACF3F41F20 FOREIGN KEY (niveau03_id) REFERENCES niveau03 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB6207AED5C04 FOREIGN KEY (pagecategory_id) REFERENCES pagecategory (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620A76ED395 FOREIGN KEY (user_id) REFERENCES useraccount (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620C4663E4 FOREIGN KEY (page_id) REFERENCES page (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE pagegroupe ADD CONSTRAINT FK_E8009F6B140AB620 FOREIGN KEY (page) REFERENCES page (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE pagegroupe ADD CONSTRAINT FK_E8009F6B4B98C21 FOREIGN KEY (groupe) REFERENCES groupe (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE pagewidget ADD CONSTRAINT FK_69400D9AC4663E4 FOREIGN KEY (page_id) REFERENCES page (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE pagewidget ADD CONSTRAINT FK_69400D9AFBE885E2 FOREIGN KEY (widget_id) REFERENCES widget (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE pagewidget ADD CONSTRAINT FK_69400D9A54B9D732 FOREIGN KEY (icon_id) REFERENCES icon (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE pagewidgetslide ADD CONSTRAINT FK_DF96542055B7C7A2 FOREIGN KEY (pagewidget_id) REFERENCES pagewidget (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE registration ADD CONSTRAINT FK_62A8A7A759FDD7AB FOREIGN KEY (niveau01_id) REFERENCES niveau01 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE registration ADD CONSTRAINT FK_62A8A7A74B487845 FOREIGN KEY (niveau02_id) REFERENCES niveau02 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE registration ADD CONSTRAINT FK_62A8A7A7F3F41F20 FOREIGN KEY (niveau03_id) REFERENCES niveau03 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE registration ADD CONSTRAINT FK_62A8A7A76E232799 FOREIGN KEY (niveau04_id) REFERENCES niveau04 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE useraccount ADD CONSTRAINT FK_E157AA1A59FDD7AB FOREIGN KEY (niveau01_id) REFERENCES niveau01 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE useraccount ADD CONSTRAINT FK_E157AA1A4B487845 FOREIGN KEY (niveau02_id) REFERENCES niveau02 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE useraccount ADD CONSTRAINT FK_E157AA1AF3F41F20 FOREIGN KEY (niveau03_id) REFERENCES niveau03 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE useraccount ADD CONSTRAINT FK_E157AA1A6E232799 FOREIGN KEY (niveau04_id) REFERENCES niveau04 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE usergroupe ADD CONSTRAINT FK_6C439BE5A76ED395 FOREIGN KEY (user_id) REFERENCES useraccount (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE usergroupe ADD CONSTRAINT FK_6C439BE5FE54D947 FOREIGN KEY (group_id) REFERENCES groupe (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE usermodo ADD CONSTRAINT FK_D162D6C4A76ED395 FOREIGN KEY (user_id) REFERENCES useraccount (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE usermodo ADD CONSTRAINT FK_D162D6C459FDD7AB FOREIGN KEY (niveau01_id) REFERENCES niveau01 (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE widget ADD CONSTRAINT FK_85F91ED054B9D732 FOREIGN KEY (icon_id) REFERENCES icon (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP SEQUENCE alert_id_seq CASCADE');
$this->addSql('DROP SEQUENCE alertcategory_id_seq CASCADE');
$this->addSql('DROP SEQUENCE audit_id_seq CASCADE');
$this->addSql('DROP SEQUENCE bookmark_id_seq CASCADE');
$this->addSql('DROP SEQUENCE cron_id_seq CASCADE');
$this->addSql('DROP SEQUENCE groupe_id_seq CASCADE');
$this->addSql('DROP SEQUENCE icon_id_seq CASCADE');
$this->addSql('DROP SEQUENCE item_id_seq CASCADE');
$this->addSql('DROP SEQUENCE itemcategory_id_seq CASCADE');
$this->addSql('DROP SEQUENCE niveau01_id_seq CASCADE');
$this->addSql('DROP SEQUENCE niveau02_id_seq CASCADE');
$this->addSql('DROP SEQUENCE niveau03_id_seq CASCADE');
$this->addSql('DROP SEQUENCE niveau04_id_seq CASCADE');
$this->addSql('DROP SEQUENCE page_id_seq CASCADE');
$this->addSql('DROP SEQUENCE pagecategory_id_seq CASCADE');
$this->addSql('DROP SEQUENCE pagewidget_id_seq CASCADE');
$this->addSql('DROP SEQUENCE pagewidgetslide_id_seq CASCADE');
$this->addSql('DROP SEQUENCE registration_id_seq CASCADE');
$this->addSql('DROP SEQUENCE useraccount_id_seq CASCADE');
$this->addSql('DROP SEQUENCE usergroupe_id_seq CASCADE');
$this->addSql('DROP SEQUENCE usermodo_id_seq CASCADE');
$this->addSql('DROP SEQUENCE whitelist_id_seq CASCADE');
$this->addSql('DROP SEQUENCE widget_id_seq CASCADE');
$this->addSql('ALTER TABLE alert DROP CONSTRAINT FK_17FD46C164C19C1');
$this->addSql('ALTER TABLE alertgroupe DROP CONSTRAINT FK_64DB975617FD46C1');
$this->addSql('ALTER TABLE alertgroupe DROP CONSTRAINT FK_64DB97564B98C21');
$this->addSql('ALTER TABLE alertuserread DROP CONSTRAINT FK_D4317FA917FD46C1');
$this->addSql('ALTER TABLE alertuserread DROP CONSTRAINT FK_D4317FA9E157AA1A');
$this->addSql('ALTER TABLE alertcategory DROP CONSTRAINT FK_EC575F7E54B9D732');
$this->addSql('ALTER TABLE bookmark DROP CONSTRAINT FK_DA62921D54B9D732');
$this->addSql('ALTER TABLE bookmark DROP CONSTRAINT FK_DA62921DA76ED395');
$this->addSql('ALTER TABLE bookmark DROP CONSTRAINT FK_DA62921D55B7C7A2');
$this->addSql('ALTER TABLE bookmark DROP CONSTRAINT FK_DA62921D126F525E');
$this->addSql('ALTER TABLE groupe DROP CONSTRAINT FK_4B98C217E3C61F9');
$this->addSql('ALTER TABLE groupe DROP CONSTRAINT FK_4B98C216D71CE5E');
$this->addSql('ALTER TABLE icon DROP CONSTRAINT FK_659429DBA76ED395');
$this->addSql('ALTER TABLE item DROP CONSTRAINT FK_1F1B251E54B9D732');
$this->addSql('ALTER TABLE item DROP CONSTRAINT FK_1F1B251E64C19C1');
$this->addSql('ALTER TABLE itemgroupe DROP CONSTRAINT FK_A4267B6D1F1B251E');
$this->addSql('ALTER TABLE itemgroupe DROP CONSTRAINT FK_A4267B6D4B98C21');
$this->addSql('ALTER TABLE itemcategory DROP CONSTRAINT FK_7959DEE854B9D732');
$this->addSql('ALTER TABLE niveau02 DROP CONSTRAINT FK_F4F52F9959FDD7AB');
$this->addSql('ALTER TABLE niveau03 DROP CONSTRAINT FK_83F21F0F4B487845');
$this->addSql('ALTER TABLE niveau04 DROP CONSTRAINT FK_1D968AACF3F41F20');
$this->addSql('ALTER TABLE page DROP CONSTRAINT FK_140AB6207AED5C04');
$this->addSql('ALTER TABLE page DROP CONSTRAINT FK_140AB620A76ED395');
$this->addSql('ALTER TABLE page DROP CONSTRAINT FK_140AB620C4663E4');
$this->addSql('ALTER TABLE pagegroupe DROP CONSTRAINT FK_E8009F6B140AB620');
$this->addSql('ALTER TABLE pagegroupe DROP CONSTRAINT FK_E8009F6B4B98C21');
$this->addSql('ALTER TABLE pagewidget DROP CONSTRAINT FK_69400D9AC4663E4');
$this->addSql('ALTER TABLE pagewidget DROP CONSTRAINT FK_69400D9AFBE885E2');
$this->addSql('ALTER TABLE pagewidget DROP CONSTRAINT FK_69400D9A54B9D732');
$this->addSql('ALTER TABLE pagewidgetslide DROP CONSTRAINT FK_DF96542055B7C7A2');
$this->addSql('ALTER TABLE registration DROP CONSTRAINT FK_62A8A7A759FDD7AB');
$this->addSql('ALTER TABLE registration DROP CONSTRAINT FK_62A8A7A74B487845');
$this->addSql('ALTER TABLE registration DROP CONSTRAINT FK_62A8A7A7F3F41F20');
$this->addSql('ALTER TABLE registration DROP CONSTRAINT FK_62A8A7A76E232799');
$this->addSql('ALTER TABLE useraccount DROP CONSTRAINT FK_E157AA1A59FDD7AB');
$this->addSql('ALTER TABLE useraccount DROP CONSTRAINT FK_E157AA1A4B487845');
$this->addSql('ALTER TABLE useraccount DROP CONSTRAINT FK_E157AA1AF3F41F20');
$this->addSql('ALTER TABLE useraccount DROP CONSTRAINT FK_E157AA1A6E232799');
$this->addSql('ALTER TABLE usergroupe DROP CONSTRAINT FK_6C439BE5A76ED395');
$this->addSql('ALTER TABLE usergroupe DROP CONSTRAINT FK_6C439BE5FE54D947');
$this->addSql('ALTER TABLE usermodo DROP CONSTRAINT FK_D162D6C4A76ED395');
$this->addSql('ALTER TABLE usermodo DROP CONSTRAINT FK_D162D6C459FDD7AB');
$this->addSql('ALTER TABLE widget DROP CONSTRAINT FK_85F91ED054B9D732');
$this->addSql('DROP TABLE alert');
$this->addSql('DROP TABLE alertgroupe');
$this->addSql('DROP TABLE alertuserread');
$this->addSql('DROP TABLE alertcategory');
$this->addSql('DROP TABLE audit');
$this->addSql('DROP TABLE bookmark');
$this->addSql('DROP TABLE config');
$this->addSql('DROP TABLE cron');
$this->addSql('DROP TABLE groupe');
$this->addSql('DROP TABLE icon');
$this->addSql('DROP TABLE item');
$this->addSql('DROP TABLE itemgroupe');
$this->addSql('DROP TABLE itemcategory');
$this->addSql('DROP TABLE niveau01');
$this->addSql('DROP TABLE niveau02');
$this->addSql('DROP TABLE niveau03');
$this->addSql('DROP TABLE niveau04');
$this->addSql('DROP TABLE page');
$this->addSql('DROP TABLE pagegroupe');
$this->addSql('DROP TABLE pagecategory');
$this->addSql('DROP TABLE pagewidget');
$this->addSql('DROP TABLE pagewidgetslide');
$this->addSql('DROP TABLE registration');
$this->addSql('DROP TABLE useraccount');
$this->addSql('DROP TABLE usergroupe');
$this->addSql('DROP TABLE usermodo');
$this->addSql('DROP TABLE whitelist');
$this->addSql('DROP TABLE widget');
$this->addSql('DROP TABLE messenger_messages');
}
}