ddl.sql 2.92 KB
Newer Older
1
2
3
4
DROP TABLE IF EXISTS Address, FormWorkingGroup, Contact, FormOrganization, MembershipForm CASCADE;
CREATE TABLE `MembershipForm` (
  `id` varchar(255) NOT NULL,
  `dateCreated` bigint(20) DEFAULT NULL,
5
  `dateUpdated` bigint(20) DEFAULT NULL,
6
  `dateSubmitted` bigint(20) DEFAULT NULL,
7
8
9
10
11
12
  `membershipLevel` varchar(255) DEFAULT NULL,
  `purchaseOrderRequired` varchar(255) DEFAULT NULL,
  `registrationCountry` varchar(255) DEFAULT NULL,
  `signingAuthority` bit(1) NOT NULL,
  `userID` varchar(255) DEFAULT NULL,
  `vatNumber` varchar(255) DEFAULT NULL,
13
  `state` varchar(255) DEFAULT NULL,
14
15
16
17
18
19
20
21
22
23
24
25
26
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `Contact` (
  `id` varchar(255) NOT NULL,
  `email` varchar(255) DEFAULT NULL,
  `fName` varchar(255) DEFAULT NULL,
  `lName` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `form_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `FK2g2hji3xsvakv5blqilnol5ad` (`form_id`),
27
  CONSTRAINT `FK2g2hji3xsvakv5blqilnol5ad` FOREIGN KEY (`form_id`) REFERENCES `MembershipForm` (`id`) ON DELETE CASCADE
28
29
30
31
32
33
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `FormOrganization` (
  `id` varchar(255) NOT NULL,
  `legalName` varchar(255) DEFAULT NULL,
  `twitterHandle` varchar(255) DEFAULT NULL,
34
  `aggregateRevenue` varchar(255) DEFAULT NULL,
35
  `organizationType` varchar(255) DEFAULT NULL,
36
  `employeeCount` varchar(255) DEFAULT NULL,
37
38
39
  `form_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_27vg3uhbmy3ev7ote4fjd4evl` (`form_id`),
40
  CONSTRAINT `FKib65ho89l5rvfgqql7wq15oxv` FOREIGN KEY (`form_id`) REFERENCES `MembershipForm` (`id`) ON DELETE CASCADE
41
42
43
44
45
46
47
48
49
50
51
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `FormWorkingGroup` (
  `id` varchar(255) NOT NULL,
  `effectiveDate` datetime(6) DEFAULT NULL,
  `participationLevel` varchar(255) DEFAULT NULL,
  `workingGroupID` varchar(255) DEFAULT NULL,
  `contact_id` varchar(255) DEFAULT NULL,
  `form_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_1gt3qh8yu1jpky54o38igvfrq` (`contact_id`),
52
  KEY `UK_2qrha8ti59jcxnvi2h8b9d2u8` (`form_id`),
53
54
  CONSTRAINT `FK8mhoi37sufequy7nnn19811rv` FOREIGN KEY (`form_id`) REFERENCES `MembershipForm` (`id`) ON DELETE CASCADE,
  CONSTRAINT `FKmnoygtwlsvh31vb4volo8odct` FOREIGN KEY (`contact_id`) REFERENCES `Contact` (`id`) ON DELETE SET NULL
55
56
57
58
59
60
61
62
63
64
65
66
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `Address` (
  `id` varchar(255) NOT NULL,
  `city` varchar(255) DEFAULT NULL,
  `country` varchar(255) DEFAULT NULL,
  `postalCode` varchar(255) DEFAULT NULL,
  `provinceState` varchar(255) DEFAULT NULL,
  `street` varchar(255) DEFAULT NULL,
  `organization_id` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UK_i4vgutrsl3ve37hc8xx7vvslf` (`organization_id`),
67
  CONSTRAINT `FKok1ylu26qjwvmfwgxlllbkj8l` FOREIGN KEY (`organization_id`) REFERENCES `FormOrganization` (`id`) ON DELETE CASCADE
68
) ENGINE=InnoDB DEFAULT CHARSET=latin1;