Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/new change brand status endpoint #7

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,5 @@ dbDump-*.sql
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
!.elasticbeanstalk/config.yml

.DS_Store
150 changes: 75 additions & 75 deletions init-project/db-user-schema-create.sql
Original file line number Diff line number Diff line change
@@ -1,93 +1,93 @@
DROP DATABASE IF EXISTS test_schema;
CREATE DATABASE test_schema
CHARACTER SET utf8mb4
COLLATE utf8mb4_bin;

use test_schema;


USE test_schema;

--
-- Table structure for table `business_account`
-- Table structure for table business_account
--

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes from this file are:

  • Removing unnecessary quotes.
  • Adding the new status column.

DROP TABLE IF EXISTS `business_account`;
CREATE TABLE `business_account` (
`id` varchar(255) NOT NULL,
`createdAt` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updatedAt` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`businessName` varchar(255) NOT NULL,
`businessLogoUrl` varchar(255) DEFAULT NULL,
`businessPhone` varchar(255) DEFAULT NULL,
`website` varchar(255) DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`deletedAt` datetime(6) DEFAULT NULL,
PRIMARY KEY (`id`)
DROP TABLE IF EXISTS business_account;
CREATE TABLE business_account (
id varchar(255) NOT NULL,
createdAt datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
updatedAt datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
businessName varchar(255) NOT NULL,
businessLogoUrl varchar(255) DEFAULT NULL,
businessPhone varchar(255) DEFAULT NULL,
website varchar(255) DEFAULT NULL,
address varchar(255) DEFAULT NULL,
deletedAt datetime(6) DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;


DROP TABLE IF EXISTS `brand`;
CREATE TABLE `brand` (
`id` varchar(255) NOT NULL,
`createdAt` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updatedAt` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`name` varchar(255) NOT NULL,
`logoUrl` varchar(255) DEFAULT NULL,
`businessAccountId` varchar(255) DEFAULT NULL,
`sector` text,
`adAccounts` text,
`socialAccounts` text,
PRIMARY KEY (`id`),
KEY `FK_ce8346e2deaf4543dd3f83304a3` (`businessAccountId`),
CONSTRAINT `FK_ce8346e2deaf4543dd3f83304a3` FOREIGN KEY (`businessAccountId`) REFERENCES `business_account` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Table structure for table `user`
-- Table structure for table brand
--

DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` varchar(255) NOT NULL,
`createdAt` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updatedAt` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`deletedAt` datetime(6) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`termsAndConditionsAccepted` datetime DEFAULT NULL,
`emailCode` varchar(255) DEFAULT NULL,
`emailVerified` tinyint NOT NULL DEFAULT '0',
`isContractValid` tinyint NOT NULL DEFAULT '1',
`lastLogin` datetime DEFAULT NULL,
`isAdmin` tinyint NOT NULL DEFAULT '0',
`businessAccountId` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `IDX_e12875dfb3b1d92d7d7c5377e2` (`email`),
KEY `FK_077f495e15f6c189c728fc5d2f3` (`businessAccountId`),
CONSTRAINT `FK_077f495e15f6c189c728fc5d2f3` FOREIGN KEY (`businessAccountId`) REFERENCES `business_account` (`id`)
DROP TABLE IF EXISTS brand;
CREATE TABLE brand (
id varchar(255) NOT NULL,
createdAt datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
updatedAt datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
name varchar(255) NOT NULL,
logoUrl varchar(255) DEFAULT NULL,
businessAccountId varchar(255) DEFAULT NULL,
sector text,
adAccounts text,
socialAccounts text,
status enum ('IN_PROGRESS','DATA_READY','MODEL_TRAINING','READY') NOT NULL DEFAULT 'IN_PROGRESS',
PRIMARY KEY (id),
KEY FK_ce8346e2deaf4543dd3f83304a3 (businessAccountId),
CONSTRAINT FK_ce8346e2deaf4543dd3f83304a3 FOREIGN KEY (businessAccountId) REFERENCES business_account (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Table structure for table `invitation`
-- Table structure for table user
--
DROP TABLE IF EXISTS user;
CREATE TABLE user (
id varchar(255) NOT NULL,
createdAt datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
updatedAt datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
deletedAt datetime(6) DEFAULT NULL,
email varchar(255) NOT NULL,
password varchar(255) DEFAULT NULL,
name varchar(255) DEFAULT NULL,
termsAndConditionsAccepted datetime DEFAULT NULL,
emailCode varchar(255) DEFAULT NULL,
emailVerified tinyint NOT NULL DEFAULT 0,
isContractValid tinyint NOT NULL DEFAULT 1,
lastLogin datetime DEFAULT NULL,
isAdmin tinyint NOT NULL DEFAULT 0,
businessAccountId varchar(255) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY IDX_e12875dfb3b1d92d7d7c5377e2 (email),
KEY FK_077f495e15f6c189c728fc5d2f3 (businessAccountId),
CONSTRAINT FK_077f495e15f6c189c728fc5d2f3 FOREIGN KEY (businessAccountId) REFERENCES business_account (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

DROP TABLE IF EXISTS `invitation`;
CREATE TABLE `invitation` (
`id` varchar(255) NOT NULL,
`createdAt` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
`updatedAt` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
`deletedAt` datetime(6) DEFAULT NULL,
`code` varchar(255) NOT NULL,
`email` varchar(255) DEFAULT NULL,
`type` varchar(255) NOT NULL DEFAULT 'referral',
`isAdmin` tinyint NOT NULL DEFAULT '0',
`expirationDate` timestamp NULL DEFAULT NULL,
`businessAccountId` varchar(255) DEFAULT NULL,
`userId` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `REL_05191060fae5b5485327709be7` (`userId`),
KEY `IDX_d23721ee8274af12ae92599425` (`code`),
KEY `FK_828861efb2f56ab91cc2f7f633f` (`businessAccountId`),
CONSTRAINT `FK_05191060fae5b5485327709be7f` FOREIGN KEY (`userId`) REFERENCES `user` (`id`),
CONSTRAINT `FK_828861efb2f56ab91cc2f7f633f` FOREIGN KEY (`businessAccountId`) REFERENCES `business_account` (`id`)
--
-- Table structure for table invitation
--
DROP TABLE IF EXISTS invitation;
CREATE TABLE invitation (
id varchar(255) NOT NULL,
createdAt datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
updatedAt datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
deletedAt datetime(6) DEFAULT NULL,
code varchar(255) NOT NULL,
email varchar(255) DEFAULT NULL,
type varchar(255) NOT NULL DEFAULT 'referral',
isAdmin tinyint NOT NULL DEFAULT 0,
expirationDate timestamp NULL DEFAULT NULL,
businessAccountId varchar(255) DEFAULT NULL,
userId varchar(255) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY REL_05191060fae5b5485327709be7 (userId),
KEY IDX_d23721ee8274af12ae92599425 (code),
KEY FK_828861efb2f56ab91cc2f7f633f (businessAccountId),
CONSTRAINT FK_05191060fae5b5485327709be7f FOREIGN KEY (userId) REFERENCES user (id),
CONSTRAINT FK_828861efb2f56ab91cc2f7f633f FOREIGN KEY (businessAccountId) REFERENCES business_account (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

4 changes: 2 additions & 2 deletions init-project/init-db-dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
--
-- Dumping data for table `brand`
--
use test_schema;
USE test_schema;
LOCK TABLES `brand` WRITE;
/*!40000 ALTER TABLE `brand` DISABLE KEYS */;
INSERT INTO `brand` VALUES ('01H4618V8XGS613BS5BSPZP180','2023-06-30 11:33:32.580809','2023-06-30 11:33:32.580809','Pharma Tecnologies','logoUrl','01H4616SGMFZ1GX71ZG5DCZMFD','PharmaceuticalsAndBiotechnology',NULL,NULL);
INSERT INTO `brand` VALUES ('01H4618V8XGS613BS5BSPZP180','2023-06-30 11:33:32.580809','2023-06-30 11:33:32.580809','Pharma Tecnologies','logoUrl','01H4616SGMFZ1GX71ZG5DCZMFD','PharmaceuticalsAndBiotechnology',NULL,NULL,'IN_PROGRESS');
/*!40000 ALTER TABLE `brand` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down
Loading