Advertisement
Guest User

payetonpote

a guest
Jun 20th, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 4.22 KB | None | 0 0
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.8.4
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Host: mysql
  6. -- Generation Time: Jun 20, 2019 at 02:08 PM
  7. -- Server version: 10.3.4-MariaDB
  8. -- PHP Version: 7.2.15
  9.  
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. SET AUTOCOMMIT = 0;
  12. START TRANSACTION;
  13. SET time_zone = "+00:00";
  14.  
  15.  
  16. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  17. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  18. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  19. /*!40101 SET NAMES utf8mb4 */;
  20.  
  21. --
  22. -- Database: `payetonpote`
  23. --
  24.  
  25. -- --------------------------------------------------------
  26.  
  27. --
  28. -- Table structure for table `campaign`
  29. --
  30.  
  31. CREATE TABLE `campaign` (
  32.   `id` varchar(32) NOT NULL,
  33.   `title` varchar(150) DEFAULT NULL,
  34.   `content` text DEFAULT NULL,
  35.   `created_at` timestamp NULL DEFAULT NULL,
  36.   `updated_at` timestamp NULL DEFAULT NULL,
  37.   `goal` int(11) DEFAULT NULL,
  38.   `author_id` int(11) DEFAULT NULL,
  39.   `name` varchar(150) DEFAULT NULL
  40. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  41.  
  42. -- --------------------------------------------------------
  43.  
  44. --
  45. -- Table structure for table `participant`
  46. --
  47.  
  48. CREATE TABLE `participant` (
  49.   `id` int(11) NOT NULL,
  50.   `name` varchar(200) DEFAULT NULL,
  51.   `email` varchar(200) DEFAULT NULL,
  52.   `campaign_id` varchar(32) NOT NULL
  53. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  54.  
  55. -- --------------------------------------------------------
  56.  
  57. --
  58. -- Table structure for table `payment`
  59. --
  60.  
  61. CREATE TABLE `payment` (
  62.   `id` int(11) NOT NULL,
  63.   `amount` int(11) DEFAULT NULL,
  64.   `created_at` timestamp NULL DEFAULT NULL,
  65.   `updated_at` timestamp NULL DEFAULT NULL,
  66.   `participant_id` int(11) NOT NULL
  67. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  68.  
  69. -- --------------------------------------------------------
  70.  
  71. --
  72. -- Table structure for table `spending`
  73. --
  74.  
  75. CREATE TABLE `spending` (
  76.   `id` int(11) NOT NULL,
  77.   `amount` int(11) DEFAULT NULL,
  78.   `created_at` timestamp NULL DEFAULT NULL,
  79.   `updated_at` timestamp NULL DEFAULT NULL,
  80.   `participant_id` int(11) NOT NULL
  81. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  82.  
  83. --
  84. -- Indexes for dumped tables
  85. --
  86.  
  87. --
  88. -- Indexes for table `campaign`
  89. --
  90. ALTER TABLE `campaign`
  91.   ADD PRIMARY KEY (`id`),
  92.   ADD KEY `fk_campaign_participant1_idx` (`author_id`);
  93.  
  94. --
  95. -- Indexes for table `participant`
  96. --
  97. ALTER TABLE `participant`
  98.   ADD PRIMARY KEY (`id`),
  99.   ADD KEY `fk_participant_campaign1_idx` (`campaign_id`);
  100.  
  101. --
  102. -- Indexes for table `payment`
  103. --
  104. ALTER TABLE `payment`
  105.   ADD PRIMARY KEY (`id`),
  106.   ADD KEY `fk_payment_participant1_idx` (`participant_id`);
  107.  
  108. --
  109. -- Indexes for table `spending`
  110. --
  111. ALTER TABLE `spending`
  112.   ADD PRIMARY KEY (`id`),
  113.   ADD KEY `fk_spending_participant1_idx` (`participant_id`);
  114.  
  115. --
  116. -- AUTO_INCREMENT for dumped tables
  117. --
  118.  
  119. --
  120. -- AUTO_INCREMENT for table `participant`
  121. --
  122. ALTER TABLE `participant`
  123.   MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  124.  
  125. --
  126. -- AUTO_INCREMENT for table `payment`
  127. --
  128. ALTER TABLE `payment`
  129.   MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  130.  
  131. --
  132. -- AUTO_INCREMENT for table `spending`
  133. --
  134. ALTER TABLE `spending`
  135.   MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  136.  
  137. --
  138. -- Constraints for dumped tables
  139. --
  140.  
  141. --
  142. -- Constraints for table `campaign`
  143. --
  144. ALTER TABLE `campaign`
  145.   ADD CONSTRAINT `fk_campaign_participant1` FOREIGN KEY (`author_id`) REFERENCES `participant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
  146.  
  147. --
  148. -- Constraints for table `participant`
  149. --
  150. ALTER TABLE `participant`
  151.   ADD CONSTRAINT `fk_participant_campaign1_idx` FOREIGN KEY (`campaign_id`) REFERENCES `campaign` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
  152.  
  153. --
  154. -- Constraints for table `payment`
  155. --
  156. ALTER TABLE `payment`
  157.   ADD CONSTRAINT `fk_payment_participant1` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
  158.  
  159. --
  160. -- Constraints for table `spending`
  161. --
  162. ALTER TABLE `spending`
  163.   ADD CONSTRAINT `fk_spending_participant1` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
  164. COMMIT;
  165.  
  166. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  167. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  168. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement