Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. CompanyProduct: create table `company_products` (`barcode` varchar(48) not null, `company_product_id` varchar(255) not null, `company_id` bigint not null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'
  2. CompanyProduct: alter table `company_products` add primary key `company_products_barcode_primary`(`barcode`)
  3. CompanyProduct: alter table `company_products` add index `company_products_barcode_index`(`barcode`)
  4. CompanyProduct: alter table `company_products` add constraint `company_products_barcode_foreign` foreign key (`barcode`) references `products` (`barcode`)
  5. Products: create table `products` (`barcode` varchar(48) not null, `name` varchar(255) not null, `energy` double not null, `fat` double not null, `protein` double not null, `salt` double not null, `carbohydrate` double not null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'
  6. Products: alter table `products` add primary key `products_barcode_primary`(`barcode`)
  7. Products: alter table `products` add index `products_barcode_index`(`barcode`)
  8. Searches: create table `searches` (`id` bigint unsigned not null auto_increment primary key, `data_source` varchar(255) not null, `product_barcode` varchar(255) not null, `date_time` datetime not null, `query_time` double not null, `result_id` bigint not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'
  9. Searches: alter table `searches` add index `searches_product_barcode_index`(`product_barcode`)
  10. Searches: alter table `searches` add index `searches_result_id_index`(`result_id`)
  11. Searches: alter table `searches` add constraint `searches_result_id_foreign` foreign key (`result_id`) references `results` (`id`) on delete cascade
  12. Searches: alter table `searches` add constraint `searches_product_barcode_foreign` foreign key (`product_barcode`) references `products` (`barcode`)
  13. Results: create table `results` (`id` bigint unsigned not null auto_increment primary key, `response` longtext not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement