Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.77 KB | None | 0 0
  1. CREATE TABLE `courses_course` (
  2.   `id` int(11) NOT NULL AUTO_INCREMENT,
  3.   `created_at` datetime(6) NOT NULL,
  4.   `updated_at` datetime(6) NOT NULL,
  5.   `start_at` datetime(6) DEFAULT NULL,
  6.   `max_attendees` int(11) NOT NULL,
  7.   `price` decimal(6,2) NOT NULL,
  8.   `location_id` int(11) NOT NULL,
  9.   `offer_id` int(11) NOT NULL,
  10.   `sublocation_id` int(11) NOT NULL,
  11.   `user_id` int(11) NOT NULL,
  12.   PRIMARY KEY (`id`),
  13.   KEY `courses_course_location_id_50c8bd8a_fk_locations_location_id` (`location_id`),
  14.   KEY `courses_course_offer_id_a1ed1671_fk_offers_offer_id` (`offer_id`),
  15.   KEY `courses_course_sublocation_id_d778a45a_fk_locations` (`sublocation_id`),
  16.   KEY `courses_course_user_id_8a39a2bb_fk_auth_user_id` (`user_id`),
  17.   CONSTRAINT `courses_course_location_id_50c8bd8a_fk_locations_location_id` FOREIGN KEY (`location_id`) REFERENCES `locations_location` (`id`),
  18.   CONSTRAINT `courses_course_offer_id_a1ed1671_fk_offers_offer_id` FOREIGN KEY (`offer_id`) REFERENCES `offers_offer` (`id`),
  19.   CONSTRAINT `courses_course_sublocation_id_d778a45a_fk_locations` FOREIGN KEY (`sublocation_id`) REFERENCES `locations_sublocation` (`id`),
  20.   CONSTRAINT `courses_course_user_id_8a39a2bb_fk_auth_user_id` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
  21. ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4
  22.  
  23. CREATE TABLE `courses_courseunit` (
  24.   `id` int(11) NOT NULL AUTO_INCREMENT,
  25.   `start_at` datetime(6) DEFAULT NULL,
  26.   `end_at` datetime(6) DEFAULT NULL,
  27.   `course_id` int(11) NOT NULL,
  28.   PRIMARY KEY (`id`),
  29.   KEY `courses_courseunit_course_id_b57ebb27_fk_courses_course_id` (`course_id`),
  30.   CONSTRAINT `courses_courseunit_course_id_b57ebb27_fk_courses_course_id` FOREIGN KEY (`course_id`) REFERENCES `courses_course` (`id`)
  31. ) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement