Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- phpMyAdmin SQL Dump
- -- version 4.8.4
- -- https://www.phpmyadmin.net/
- --
- -- Host: mysql
- -- Generation Time: Jun 20, 2019 at 02:08 PM
- -- Server version: 10.3.4-MariaDB
- -- PHP Version: 7.2.15
- SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
- SET AUTOCOMMIT = 0;
- START TRANSACTION;
- SET time_zone = "+00:00";
- /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
- /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
- /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
- /*!40101 SET NAMES utf8mb4 */;
- --
- -- Database: `payetonpote`
- --
- -- --------------------------------------------------------
- --
- -- Table structure for table `campaign`
- --
- CREATE TABLE `campaign` (
- `id` varchar(32) NOT NULL,
- `title` varchar(150) DEFAULT NULL,
- `content` text DEFAULT NULL,
- `created_at` timestamp NULL DEFAULT NULL,
- `updated_at` timestamp NULL DEFAULT NULL,
- `goal` int(11) DEFAULT NULL,
- `author_id` int(11) DEFAULT NULL,
- `name` varchar(150) DEFAULT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- -- --------------------------------------------------------
- --
- -- Table structure for table `participant`
- --
- CREATE TABLE `participant` (
- `id` int(11) NOT NULL,
- `name` varchar(200) DEFAULT NULL,
- `email` varchar(200) DEFAULT NULL,
- `campaign_id` varchar(32) NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- -- --------------------------------------------------------
- --
- -- Table structure for table `payment`
- --
- CREATE TABLE `payment` (
- `id` int(11) NOT NULL,
- `amount` int(11) DEFAULT NULL,
- `created_at` timestamp NULL DEFAULT NULL,
- `updated_at` timestamp NULL DEFAULT NULL,
- `participant_id` int(11) NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- -- --------------------------------------------------------
- --
- -- Table structure for table `spending`
- --
- CREATE TABLE `spending` (
- `id` int(11) NOT NULL,
- `amount` int(11) DEFAULT NULL,
- `created_at` timestamp NULL DEFAULT NULL,
- `updated_at` timestamp NULL DEFAULT NULL,
- `participant_id` int(11) NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- --
- -- Indexes for dumped tables
- --
- --
- -- Indexes for table `campaign`
- --
- ALTER TABLE `campaign`
- ADD PRIMARY KEY (`id`),
- ADD KEY `fk_campaign_participant1_idx` (`author_id`);
- --
- -- Indexes for table `participant`
- --
- ALTER TABLE `participant`
- ADD PRIMARY KEY (`id`),
- ADD KEY `fk_participant_campaign1_idx` (`campaign_id`);
- --
- -- Indexes for table `payment`
- --
- ALTER TABLE `payment`
- ADD PRIMARY KEY (`id`),
- ADD KEY `fk_payment_participant1_idx` (`participant_id`);
- --
- -- Indexes for table `spending`
- --
- ALTER TABLE `spending`
- ADD PRIMARY KEY (`id`),
- ADD KEY `fk_spending_participant1_idx` (`participant_id`);
- --
- -- AUTO_INCREMENT for dumped tables
- --
- --
- -- AUTO_INCREMENT for table `participant`
- --
- ALTER TABLE `participant`
- MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
- --
- -- AUTO_INCREMENT for table `payment`
- --
- ALTER TABLE `payment`
- MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
- --
- -- AUTO_INCREMENT for table `spending`
- --
- ALTER TABLE `spending`
- MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
- --
- -- Constraints for dumped tables
- --
- --
- -- Constraints for table `campaign`
- --
- ALTER TABLE `campaign`
- ADD CONSTRAINT `fk_campaign_participant1` FOREIGN KEY (`author_id`) REFERENCES `participant` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
- --
- -- Constraints for table `participant`
- --
- ALTER TABLE `participant`
- ADD CONSTRAINT `fk_participant_campaign1_idx` FOREIGN KEY (`campaign_id`) REFERENCES `campaign` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
- --
- -- Constraints for table `payment`
- --
- ALTER TABLE `payment`
- ADD CONSTRAINT `fk_payment_participant1` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
- --
- -- Constraints for table `spending`
- --
- ALTER TABLE `spending`
- ADD CONSTRAINT `fk_spending_participant1` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;
- COMMIT;
- /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
- /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
- /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement