From ee236ff74aaac1882a825817d5ce8f692d3bdd0f Mon Sep 17 00:00:00 2001 From: ragueneaul Date: Thu, 21 Nov 2024 16:52:37 +0100 Subject: [PATCH] templates v2 --- .idea/dataSources.xml | 7 +++ .idea/workspace.xml | 43 +++++++---------- migrations/Version20241121154657.php | 70 ++++++++++++++++++++++++++++ templates/user/list.html.twig | 2 +- 4 files changed, 94 insertions(+), 28 deletions(-) create mode 100644 migrations/Version20241121154657.php diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 08c0eb6..9b096cc 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -8,5 +8,12 @@ jdbc:postgresql://172.20.96.1:5432/chauffageproj $ProjectFileDir$ + + postgresql + true + org.postgresql.Driver + jdbc:postgresql://172.20.96.1:5432/chauffageproj + $ProjectFileDir$ + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 966b661..c33b8b6 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,18 +5,7 @@ - - - - - - - - - - - - { + "keyToString": { + "RunOnceActivity.ShowReadmeOnStart": "true", + "RunOnceActivity.git.unshallow": "true", + "git-widget-placeholder": "develop", + "last_opened_file_path": "/home/ragueneaul@stsio.lan/Documents/DecoMaison_Lucas_Ragueneau", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "nodejs_package_manager_path": "npm", + "vue.rearranger.settings.migration": "true" }, - "keyToStringList": { - "DatabaseDriversLRU": [ - "postgresql" + "keyToStringList": { + "DatabaseDriversLRU": [ + "postgresql" ] } -}]]> +} diff --git a/migrations/Version20241121154657.php b/migrations/Version20241121154657.php new file mode 100644 index 0000000..55567a9 --- /dev/null +++ b/migrations/Version20241121154657.php @@ -0,0 +1,70 @@ +addSql('CREATE SEQUENCE fault_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE intervention_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE skill_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE stock_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE "user_id_seq" INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE SEQUENCE vehicle_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE fault (id INT NOT NULL, wording VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE intervention (id INT NOT NULL, wording VARCHAR(255) NOT NULL, timestamp TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, description VARCHAR(255) NOT NULL, address VARCHAR(255) NOT NULL, status VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE skill (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE stock (id INT NOT NULL, wording VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, quantity VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE "user" (id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birth_date DATE NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE vehicle (id INT NOT NULL, license_plate VARCHAR(255) NOT NULL, brand VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + $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('COMMENT ON COLUMN messenger_messages.created_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN messenger_messages.available_at IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN messenger_messages.delivered_at IS \'(DC2Type:datetime_immutable)\''); + $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();'); + } + + 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 fault_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE intervention_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE skill_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE stock_id_seq CASCADE'); + $this->addSql('DROP SEQUENCE "user_id_seq" CASCADE'); + $this->addSql('DROP SEQUENCE vehicle_id_seq CASCADE'); + $this->addSql('DROP TABLE fault'); + $this->addSql('DROP TABLE intervention'); + $this->addSql('DROP TABLE skill'); + $this->addSql('DROP TABLE stock'); + $this->addSql('DROP TABLE "user"'); + $this->addSql('DROP TABLE vehicle'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/templates/user/list.html.twig b/templates/user/list.html.twig index 7477b1e..e48b70b 100644 --- a/templates/user/list.html.twig +++ b/templates/user/list.html.twig @@ -7,7 +7,7 @@ {{ user.FirstName }} {{ user.LastName }} {{ user.BirthDate|date("Y-m-d") }} - {{ user.Mail }} + {{ user.Email }} {{ user.Phone }} {{ user.Type }} {% endfor %}