CREATE TABLE `agent_gmb_details` (
  `id` int(11) NOT NULL,
  `agentId` int(11) NOT NULL,
  `businessName` varchar(258) NOT NULL,
  `accountName` varchar(128) NOT NULL,
  `businessLocationName` varchar(256) NOT NULL,
  `locationName` varchar(128) NOT NULL,
  `authToken` varchar(512) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

-- --------------------------------------------------------

--
-- Table structure for table `artworks`
--

CREATE TABLE `artworks` (
  `id` int(11) NOT NULL,
  `artWorkName` varchar(50) DEFAULT NULL,
  `artWorkType` int(11) DEFAULT NULL,
  `artWorkUrl` varchar(128) NOT NULL,
  `artWorkVectorUrl` varchar(128) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `createdBy` int(11) NOT NULL,
  `updatedBy` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `artwork_type`
--

CREATE TABLE `artwork_type` (
  `id` int(11) NOT NULL,
  `typeName` varchar(128) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;

--
-- Dumping data for table `artwork_type`
--

INSERT INTO `artwork_type` (`id`, `typeName`, `created_at`, `updated_at`, `status`) VALUES
(1, 'Elongated Logo', '2019-09-16 09:32:25', '2019-09-16 09:32:33', 1),
(2, 'House Logo', '2019-09-16 09:32:25', '2019-09-16 09:32:37', 1),
(3, 'House with Words Logo', '2019-09-16 09:32:53', '2019-09-16 09:32:53', 1);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `agent_gmb_details`
--
ALTER TABLE `agent_gmb_details`
  ADD PRIMARY KEY (`id`),
  ADD KEY `FK_gmb_to_agent` (`agentId`);

--
-- Indexes for table `artworks`
--
ALTER TABLE `artworks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `artwork _typ_to_art_work` (`artWorkType`);

--
-- Indexes for table `artwork_type`
--
ALTER TABLE `artwork_type`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `agent_gmb_details`
--
ALTER TABLE `agent_gmb_details`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `artworks`
--
ALTER TABLE `artworks`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `artwork_type`
--
ALTER TABLE `artwork_type`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `agent_gmb_details`
--
ALTER TABLE `agent_gmb_details`
  ADD CONSTRAINT `FK_gmb_to_agent` FOREIGN KEY (`agentId`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

--
-- Constraints for table `artworks`
--
ALTER TABLE `artworks`
  ADD CONSTRAINT `artwork _typ_to_art_work` FOREIGN KEY (`artWorkType`) REFERENCES `artwork_type` (`id`) ON DELETE SET NULL ON UPDATE CASCADE;