Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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'
- CompanyProduct: alter table `company_products` add primary key `company_products_barcode_primary`(`barcode`)
- CompanyProduct: alter table `company_products` add index `company_products_barcode_index`(`barcode`)
- CompanyProduct: alter table `company_products` add constraint `company_products_barcode_foreign` foreign key (`barcode`) references `products` (`barcode`)
- 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'
- Products: alter table `products` add primary key `products_barcode_primary`(`barcode`)
- Products: alter table `products` add index `products_barcode_index`(`barcode`)
- 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'
- Searches: alter table `searches` add index `searches_product_barcode_index`(`product_barcode`)
- Searches: alter table `searches` add index `searches_result_id_index`(`result_id`)
- Searches: alter table `searches` add constraint `searches_result_id_foreign` foreign key (`result_id`) references `results` (`id`) on delete cascade
- Searches: alter table `searches` add constraint `searches_product_barcode_foreign` foreign key (`product_barcode`) references `products` (`barcode`)
- 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