Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.03 KB | None | 0 0
  1. CREATE TABLE `incoming_payment` (
  2.   `incoming_payment_key` varchar(36) NOT NULL,
  3.   `reference_id` varchar(255) NOT NULL,
  4.   `amount_cents` bigint(21) DEFAULT NULL,
  5.   `amount_currency_code` varchar(255) DEFAULT NULL,
  6.   `ref_buyer_key` varchar(36) DEFAULT NULL,
  7.   `ref_ach_key` varchar(36) DEFAULT NULL,
  8.   `created_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
  9.   `updated_at` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  10.   PRIMARY KEY (`incoming_payment_key`),
  11.   UNIQUE KEY `incoming_payment_key` (`incoming_payment_key`),
  12.   KEY `idx_reference_id` (`reference_id`),
  13.   KEY `idx_ref_buyer_key` (`ref_buyer_key`),
  14.   KEY `idx_ref_ach_key` (`ref_ach_key`),
  15.   KEY `idx_created_at` (`created_at`),
  16.   KEY `idx_updated_at` (`updated_at`),
  17.   CONSTRAINT `fk_incoming_payment_ref_buyer_key` FOREIGN KEY (`ref_buyer_key`) REFERENCES `buyer` (`buyer_key`) ON DELETE CASCADE,
  18.   CONSTRAINT `fk_incoming_payment_ref_ach_account_key` FOREIGN KEY (`ref_ach_key`) REFERENCES `ach` (`ach_key`) ON DELETE CASCADE
  19. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement