'SET foreign_key_checks=0;

--
-- Table: `api_responses`
--
CREATE TABLE `api_responses` (
  `code` integer NULL,
  `id` integer NOT NULL auto_increment,
  `message` varchar(255) NULL,
  `type` varchar(255) NULL,
  INDEX `pk_id` (`id`),
  PRIMARY KEY (`id`)
);

--
-- Table: `categories`
--
CREATE TABLE `categories` (
  `id` bigint NOT NULL auto_increment,
  `name` varchar(255) NULL,
  INDEX `pk_id` (`id`),
  PRIMARY KEY (`id`)
) ENGINE=InnoDB;

--
-- Table: `orders`
--
CREATE TABLE `orders` (
  `complete` tinyint NULL,
  `id` bigint NOT NULL auto_increment,
  `petId` bigint NULL,
  `quantity` integer NULL,
  `shipDate` datetime NULL,
  `status` enum(\'placed\', \'approved\', \'delivered\') NULL comment \'Order Status\',
  INDEX `pk_id` (`id`),
  PRIMARY KEY (`id`)
);

--
-- Table: `pets`
--
CREATE TABLE `pets` (
  `id` bigint NOT NULL auto_increment,
  `name` varchar(255) NOT NULL,
  `status` enum(\'available\', \'pending\', \'sold\') NULL comment \'pet status in the store\',
  `category_id` bigint NULL,
  INDEX `pk_id` (`id`),
  INDEX (`category_id`),
  PRIMARY KEY (`id`),
  CONSTRAINT `pets_fk` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`)
) ENGINE=InnoDB;

--
-- Table: `pet_photo_urls`
--
CREATE TABLE `pet_photo_urls` (
  `id` integer NOT NULL auto_increment,
  `value` varchar(255) NOT NULL,
  `photoUrl_id` bigint NOT NULL,
  INDEX `pk_id` (`id`),
  INDEX (`photoUrl_id`),
  PRIMARY KEY (`id`),
  CONSTRAINT `pet_photo_urls_fk` FOREIGN KEY (`photoUrl_id`) REFERENCES `pets` (`id`)
) ENGINE=InnoDB;

--
-- Table: `tags`
--
CREATE TABLE `tags` (
  `id` bigint NOT NULL auto_increment,
  `name` varchar(255) NULL,
  `tag_id` bigint NOT NULL,
  INDEX `pk_id` (`id`),
  INDEX (`tag_id`),
  PRIMARY KEY (`id`),
  CONSTRAINT `tags_fk` FOREIGN KEY (`tag_id`) REFERENCES `pets` (`id`)
) ENGINE=InnoDB;

--
-- Table: `users`
--
CREATE TABLE `users` (
  `email` varchar(255) NULL,
  `firstName` varchar(255) NULL,
  `id` bigint NOT NULL auto_increment,
  `lastName` varchar(255) NULL,
  `password` varchar(255) NULL,
  `phone` varchar(255) NULL,
  `userStatus` integer NULL comment \'User Status\',
  `username` varchar(255) NULL,
  INDEX `pk_id` (`id`),
  PRIMARY KEY (`id`)
);

SET foreign_key_checks=1;'
