From 325447b6d4109fd0ed5b49c682fcf73f99faced8 Mon Sep 17 00:00:00 2001 From: OtavioPedroso Date: Sun, 25 Jul 2021 15:51:34 -0300 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20defini=C3=A7=C3=A3o=20de=20default?= =?UTF-8?q?=201=20para=20os=20multiplicadores=20de=20pontos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DDL_gerenciadorPontos.sql | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/DDL_gerenciadorPontos.sql b/DDL_gerenciadorPontos.sql index 4e7fa28..faaa7a2 100644 --- a/DDL_gerenciadorPontos.sql +++ b/DDL_gerenciadorPontos.sql @@ -45,6 +45,7 @@ CREATE TABLE rules ( deleted_at TIMESTAMP NULL DEFAULT NULL ); + CREATE TABLE events ( id INTEGER AUTO_INCREMENT PRIMARY KEY, name VARCHAR(50), @@ -63,9 +64,13 @@ CREATE TABLE rules_categories ( id INTEGER AUTO_INCREMENT PRIMARY KEY, active_ BOOLEAN, rules_id INTEGER, - categories_id INTEGER + categories_id INTEGER, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP(), + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP(), + deleted_at TIMESTAMP NULL DEFAULT NULL ); + CREATE TABLE events_members ( id INTEGER AUTO_INCREMENT PRIMARY KEY, members_id INTEGER, @@ -127,7 +132,7 @@ CREATE TABLE badges_members ( ); CREATE TABLE scores ( score_id INTEGER AUTO_INCREMENT PRIMARY KEY, - multiplier_value INTEGER, + multiplier_value INTEGER DEFAULT 1, members_id INTEGER, events_id INTEGER, categories_id INTEGER, @@ -139,6 +144,7 @@ CREATE TABLE scores ( + ALTER TABLE seasons ADD CONSTRAINT FK_season_enterprise FOREIGN KEY (enterprises_id) @@ -251,3 +257,9 @@ ALTER TABLE scores ADD CONSTRAINT FK_scores_5 +select * FROM scores; + +select * from events where id=36; + + +DROP DATABASE gerenciador_pontos; \ No newline at end of file From fbb3c6d92380fe19558ebd2609bc9d4a42715a4c Mon Sep 17 00:00:00 2001 From: OtavioPedroso Date: Sun, 25 Jul 2021 15:53:02 -0300 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20defini=C3=A7=C3=A3o=20de=20default?= =?UTF-8?q?=201=20para=20os=20multiplicadores=20de=20pontos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DDL_gerenciadorPontos.sql | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/DDL_gerenciadorPontos.sql b/DDL_gerenciadorPontos.sql index faaa7a2..ef4bfa8 100644 --- a/DDL_gerenciadorPontos.sql +++ b/DDL_gerenciadorPontos.sql @@ -255,11 +255,4 @@ ALTER TABLE scores ADD CONSTRAINT FK_scores_5 REFERENCES rules (id) ON DELETE CASCADE; - - -select * FROM scores; - -select * from events where id=36; - - -DROP DATABASE gerenciador_pontos; \ No newline at end of file + \ No newline at end of file