diff options
| author | Ran Guin <[email protected]> | 2021-05-13 14:51:38 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-06-04 22:38:18 -0700 |
| commit | 8b0d41cb8f2296047611f9fc9745ce8c5deefdd2 (patch) | |
| tree | cb923bf69ea71ecebe28bf022fb5c0968d17109f /db/migrations | |
| parent | 8bac6764dceac97e09c66c99a2503fa41c60e5b1 (diff) | |
| download | coinos-server-8b0d41cb8f2296047611f9fc9745ce8c5deefdd2.tar.gz coinos-server-8b0d41cb8f2296047611f9fc9745ce8c5deefdd2.zip | |
add migrations for referrals & waiting list
Diffstat (limited to 'db/migrations')
| -rw-r--r-- | db/migrations/referrals.sql | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/db/migrations/referrals.sql b/db/migrations/referrals.sql new file mode 100644 index 00000000..b755000a --- /dev/null +++ b/db/migrations/referrals.sql @@ -0,0 +1,30 @@ +-- Note: Adding FK contraints may cause issues, so I have commented them out for now, but these need to be established + +CREATE TABLE `referrals` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `token` varchar(255) DEFAULT NULL UNIQUE, + `expiry` date DEFAULT NULL, + `status` enum('pending','active','expired','cancelled') DEFAULT NULL, + `sponsor_id` int(11) NOT NULL, + `user_id` int(11) DEFAULT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `updated_at` datetime DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `sponsor_id` (`sponsor_id`), + KEY `user_id` (`user_id`) + -- FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), + -- FOREIGN KEY (`sponsor_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1 + +CREATE TABLE `waiting_list` ( + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `email` varchar(255) DEFAULT NULL UNIQUE, + `sms` varchar(255) DEFAULT NULL, + `user_id` int(11) DEFAULT NULL, + `status` enum('pending','contacted','registered','cancelled') DEFAULT 'pending', + `notes` text DEFAULT NULL, + `created_at` datetime DEFAULT CURRENT_TIMESTAMP, + `updated_at` datetime DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) + -- CONSTRAINT `user_id_fk` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
\ No newline at end of file |
