43 lines
1.7 KiB
SQL
43 lines
1.7 KiB
SQL
-- +goose Up
|
|
-- cmc.quotes definition (matches existing database)
|
|
|
|
CREATE TABLE IF NOT EXISTS `quotes` (
|
|
`created` datetime NOT NULL,
|
|
`modified` datetime NOT NULL,
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`enquiry_id` int(50) NOT NULL,
|
|
`currency_id` int(11) NOT NULL,
|
|
`revision` int(5) NOT NULL COMMENT 'limited at 5 digits. Really, you''re not going to have more revisions of a single quote than that',
|
|
`delivery_time` varchar(400) NOT NULL COMMENT 'estimated delivery time for quote',
|
|
`delivery_time_frame` varchar(100) NOT NULL,
|
|
`payment_terms` varchar(400) NOT NULL,
|
|
`days_valid` int(3) NOT NULL,
|
|
`date_issued` date NOT NULL,
|
|
`valid_until` date NOT NULL,
|
|
`reminders_disabled` tinyint(1) DEFAULT 0,
|
|
`reminders_disabled_at` datetime DEFAULT NULL,
|
|
`reminders_disabled_by` varchar(100) DEFAULT NULL,
|
|
`delivery_point` varchar(400) NOT NULL,
|
|
`exchange_rate` varchar(255) NOT NULL,
|
|
`customs_duty` varchar(255) NOT NULL,
|
|
`document_id` int(11) NOT NULL,
|
|
`commercial_comments` text DEFAULT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=MyISAM AUTO_INCREMENT=18245 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
|
|
|
-- cmc.quote_reminders definition
|
|
CREATE TABLE IF NOT EXISTS `quote_reminders` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`quote_id` int(11) NOT NULL,
|
|
`reminder_type` int(3) NOT NULL COMMENT '1=1st, 2=2nd, 3=3rd reminder',
|
|
`date_sent` datetime NOT NULL,
|
|
`username` varchar(100) DEFAULT NULL COMMENT 'User who manually (re)sent the reminder',
|
|
PRIMARY KEY (`id`),
|
|
KEY `quote_id` (`quote_id`),
|
|
CONSTRAINT `quote_reminders_ibfk_1` FOREIGN KEY (`quote_id`) REFERENCES `quotes` (`id`)
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
|
|
|
|
-- +goose Down
|
|
DROP TABLE IF EXISTS `quote_reminders`;
|
|
DROP TABLE IF EXISTS `quotes`;
|