1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00
invoiceninja/database/setup.sql

2883 lines
368 KiB
MySQL
Raw Normal View History

2018-02-12 09:43:31 +01:00
-- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
--
-- Host: localhost Database: ninja
-- ------------------------------------------------------
2018-02-12 09:43:31 +01:00
-- Server version 5.7.21-0ubuntu0.16.04.1
/*!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 utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
2017-03-31 17:02:56 +02:00
--
-- Table structure for table `account_email_settings`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_email_settings` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`reply_to_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`bcc_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email_subject_invoice` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email_subject_quote` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email_subject_payment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email_template_invoice` text COLLATE utf8_unicode_ci NOT NULL,
`email_template_quote` text COLLATE utf8_unicode_ci NOT NULL,
`email_template_payment` text COLLATE utf8_unicode_ci NOT NULL,
`email_subject_reminder1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email_subject_reminder2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email_subject_reminder3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email_template_reminder1` text COLLATE utf8_unicode_ci NOT NULL,
`email_template_reminder2` text COLLATE utf8_unicode_ci NOT NULL,
`email_template_reminder3` text COLLATE utf8_unicode_ci NOT NULL,
2017-08-07 13:12:47 +02:00
`late_fee1_amount` decimal(13,2) DEFAULT NULL,
`late_fee1_percent` decimal(13,3) DEFAULT NULL,
`late_fee2_amount` decimal(13,2) DEFAULT NULL,
`late_fee2_percent` decimal(13,3) DEFAULT NULL,
`late_fee3_amount` decimal(13,2) DEFAULT NULL,
`late_fee3_percent` decimal(13,3) DEFAULT NULL,
2018-01-01 22:17:36 +01:00
`email_subject_reminder4` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email_template_reminder4` text COLLATE utf8_unicode_ci,
`frequency_id_reminder4` int(10) unsigned DEFAULT NULL,
2018-02-12 09:43:31 +01:00
`email_subject_proposal` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email_template_proposal` text COLLATE utf8_unicode_ci,
2017-03-31 17:02:56 +02:00
PRIMARY KEY (`id`),
KEY `account_email_settings_account_id_index` (`account_id`),
CONSTRAINT `account_email_settings_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `account_email_settings`
--
LOCK TABLES `account_email_settings` WRITE;
/*!40000 ALTER TABLE `account_email_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `account_email_settings` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `account_gateway_settings`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_gateway_settings` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`gateway_type_id` int(10) unsigned DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`min_limit` int(10) unsigned DEFAULT NULL,
`max_limit` int(10) unsigned DEFAULT NULL,
2017-02-27 17:02:14 +01:00
`fee_amount` decimal(13,2) DEFAULT NULL,
`fee_percent` decimal(13,3) DEFAULT NULL,
`fee_tax_name1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`fee_tax_name2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`fee_tax_rate1` decimal(13,3) DEFAULT NULL,
`fee_tax_rate2` decimal(13,3) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `account_gateway_settings_account_id_foreign` (`account_id`),
KEY `account_gateway_settings_user_id_foreign` (`user_id`),
KEY `account_gateway_settings_gateway_type_id_foreign` (`gateway_type_id`),
CONSTRAINT `account_gateway_settings_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `account_gateway_settings_gateway_type_id_foreign` FOREIGN KEY (`gateway_type_id`) REFERENCES `gateway_types` (`id`) ON DELETE CASCADE,
CONSTRAINT `account_gateway_settings_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `account_gateway_settings`
--
LOCK TABLES `account_gateway_settings` WRITE;
/*!40000 ALTER TABLE `account_gateway_settings` DISABLE KEYS */;
/*!40000 ALTER TABLE `account_gateway_settings` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `account_gateway_tokens`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_gateway_tokens` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`contact_id` int(10) unsigned NOT NULL,
`account_gateway_id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`default_payment_method_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `account_gateway_tokens_account_id_foreign` (`account_id`),
KEY `account_gateway_tokens_contact_id_foreign` (`contact_id`),
KEY `account_gateway_tokens_account_gateway_id_foreign` (`account_gateway_id`),
KEY `account_gateway_tokens_client_id_foreign` (`client_id`),
KEY `account_gateway_tokens_default_payment_method_id_foreign` (`default_payment_method_id`),
CONSTRAINT `account_gateway_tokens_account_gateway_id_foreign` FOREIGN KEY (`account_gateway_id`) REFERENCES `account_gateways` (`id`) ON DELETE CASCADE,
CONSTRAINT `account_gateway_tokens_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `account_gateway_tokens_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE,
CONSTRAINT `account_gateway_tokens_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
CONSTRAINT `account_gateway_tokens_default_payment_method_id_foreign` FOREIGN KEY (`default_payment_method_id`) REFERENCES `payment_methods` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `account_gateway_tokens`
--
LOCK TABLES `account_gateway_tokens` WRITE;
/*!40000 ALTER TABLE `account_gateway_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `account_gateway_tokens` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `account_gateways`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_gateways` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`gateway_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`config` text COLLATE utf8_unicode_ci NOT NULL,
`public_id` int(10) unsigned NOT NULL,
`accepted_credit_cards` int(10) unsigned DEFAULT NULL,
`show_address` tinyint(1) DEFAULT '1',
`update_address` tinyint(1) DEFAULT '1',
`require_cvv` tinyint(1) DEFAULT '1',
2017-12-11 20:33:50 +01:00
`show_shipping_address` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `account_gateways_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `account_gateways_gateway_id_foreign` (`gateway_id`),
KEY `account_gateways_user_id_foreign` (`user_id`),
KEY `account_gateways_public_id_index` (`public_id`),
CONSTRAINT `account_gateways_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `account_gateways_gateway_id_foreign` FOREIGN KEY (`gateway_id`) REFERENCES `gateways` (`id`),
CONSTRAINT `account_gateways_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `account_gateways`
--
LOCK TABLES `account_gateways` WRITE;
/*!40000 ALTER TABLE `account_gateways` DISABLE KEYS */;
/*!40000 ALTER TABLE `account_gateways` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `account_tokens`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `account_tokens` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`public_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `account_tokens_token_unique` (`token`),
UNIQUE KEY `account_tokens_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `account_tokens_user_id_foreign` (`user_id`),
KEY `account_tokens_account_id_index` (`account_id`),
CONSTRAINT `account_tokens_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `account_tokens_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `account_tokens`
--
LOCK TABLES `account_tokens` WRITE;
/*!40000 ALTER TABLE `account_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `account_tokens` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `accounts`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`timezone_id` int(10) unsigned DEFAULT NULL,
`date_format_id` int(10) unsigned DEFAULT NULL,
`datetime_format_id` int(10) unsigned DEFAULT NULL,
`currency_id` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`ip` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`account_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`last_login` timestamp NULL DEFAULT NULL,
`address1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`address2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`postal_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`country_id` int(10) unsigned DEFAULT NULL,
`invoice_terms` text COLLATE utf8_unicode_ci,
`email_footer` text COLLATE utf8_unicode_ci,
`industry_id` int(10) unsigned DEFAULT NULL,
`size_id` int(10) unsigned DEFAULT NULL,
`invoice_taxes` tinyint(1) NOT NULL DEFAULT '1',
`invoice_item_taxes` tinyint(1) NOT NULL DEFAULT '0',
`invoice_design_id` int(10) unsigned NOT NULL DEFAULT '1',
`work_phone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`work_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`language_id` int(10) unsigned NOT NULL DEFAULT '1',
`custom_value1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_value2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`fill_products` tinyint(1) NOT NULL DEFAULT '1',
`update_products` tinyint(1) NOT NULL DEFAULT '1',
`primary_color` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`secondary_color` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`hide_quantity` tinyint(1) NOT NULL DEFAULT '0',
`hide_paid_to_date` tinyint(1) NOT NULL DEFAULT '0',
`custom_invoice_taxes1` tinyint(1) DEFAULT NULL,
`custom_invoice_taxes2` tinyint(1) DEFAULT NULL,
`vat_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`invoice_number_prefix` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`invoice_number_counter` int(11) DEFAULT '1',
`quote_number_prefix` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`quote_number_counter` int(11) DEFAULT '1',
`share_counter` tinyint(1) NOT NULL DEFAULT '1',
`id_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`token_billing_type_id` smallint(6) NOT NULL DEFAULT '4',
`invoice_footer` text COLLATE utf8_unicode_ci,
`pdf_email_attachment` smallint(6) NOT NULL DEFAULT '0',
`subdomain` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`font_size` smallint(6) NOT NULL DEFAULT '9',
`invoice_labels` text COLLATE utf8_unicode_ci,
2017-06-01 18:13:13 +02:00
`custom_design1` mediumtext COLLATE utf8_unicode_ci,
`show_item_taxes` tinyint(1) NOT NULL DEFAULT '0',
`iframe_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`military_time` tinyint(1) NOT NULL DEFAULT '0',
`enable_reminder1` tinyint(1) NOT NULL DEFAULT '0',
`enable_reminder2` tinyint(1) NOT NULL DEFAULT '0',
`enable_reminder3` tinyint(1) NOT NULL DEFAULT '0',
`num_days_reminder1` smallint(6) NOT NULL DEFAULT '7',
`num_days_reminder2` smallint(6) NOT NULL DEFAULT '14',
`num_days_reminder3` smallint(6) NOT NULL DEFAULT '30',
`recurring_hour` smallint(6) NOT NULL DEFAULT '8',
`invoice_number_pattern` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`quote_number_pattern` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`quote_terms` text COLLATE utf8_unicode_ci,
`email_design_id` smallint(6) NOT NULL DEFAULT '1',
`enable_email_markup` tinyint(1) NOT NULL DEFAULT '0',
`website` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`direction_reminder1` smallint(6) NOT NULL DEFAULT '1',
`direction_reminder2` smallint(6) NOT NULL DEFAULT '1',
`direction_reminder3` smallint(6) NOT NULL DEFAULT '1',
`field_reminder1` smallint(6) NOT NULL DEFAULT '1',
`field_reminder2` smallint(6) NOT NULL DEFAULT '1',
`field_reminder3` smallint(6) NOT NULL DEFAULT '1',
`client_view_css` text COLLATE utf8_unicode_ci,
`header_font_id` int(10) unsigned NOT NULL DEFAULT '1',
`body_font_id` int(10) unsigned NOT NULL DEFAULT '1',
`auto_convert_quote` tinyint(1) NOT NULL DEFAULT '1',
`all_pages_footer` tinyint(1) NOT NULL,
`all_pages_header` tinyint(1) NOT NULL,
`show_currency_code` tinyint(1) NOT NULL,
`enable_portal_password` tinyint(1) NOT NULL DEFAULT '0',
`send_portal_password` tinyint(1) NOT NULL DEFAULT '0',
`recurring_invoice_number_prefix` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'R',
`enable_client_portal` tinyint(1) NOT NULL DEFAULT '1',
`invoice_fields` text COLLATE utf8_unicode_ci,
`devices` text COLLATE utf8_unicode_ci,
`logo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`logo_width` int(10) unsigned NOT NULL,
`logo_height` int(10) unsigned NOT NULL,
`logo_size` int(10) unsigned NOT NULL,
`invoice_embed_documents` tinyint(1) NOT NULL DEFAULT '0',
`document_email_attachment` tinyint(1) NOT NULL DEFAULT '0',
`enable_client_portal_dashboard` tinyint(1) NOT NULL DEFAULT '1',
`company_id` int(10) unsigned DEFAULT NULL,
`page_size` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'A4',
`live_preview` tinyint(1) NOT NULL DEFAULT '1',
`invoice_number_padding` smallint(6) NOT NULL DEFAULT '4',
`enable_second_tax_rate` tinyint(1) NOT NULL DEFAULT '0',
`auto_bill_on_due_date` tinyint(1) NOT NULL DEFAULT '0',
`start_of_week` int(11) NOT NULL,
`enable_buy_now_buttons` tinyint(1) NOT NULL DEFAULT '0',
`include_item_taxes_inline` tinyint(1) NOT NULL DEFAULT '0',
`financial_year_start` date DEFAULT NULL,
`enabled_modules` smallint(6) NOT NULL DEFAULT '63',
`enabled_dashboard_sections` smallint(6) NOT NULL DEFAULT '7',
`show_accept_invoice_terms` tinyint(1) NOT NULL DEFAULT '0',
`show_accept_quote_terms` tinyint(1) NOT NULL DEFAULT '0',
`require_invoice_signature` tinyint(1) NOT NULL DEFAULT '0',
`require_quote_signature` tinyint(1) NOT NULL DEFAULT '0',
`client_number_prefix` text COLLATE utf8_unicode_ci,
`client_number_counter` int(11) DEFAULT '0',
`client_number_pattern` text COLLATE utf8_unicode_ci,
`domain_id` tinyint(3) unsigned DEFAULT '1',
`payment_terms` tinyint(4) DEFAULT NULL,
2017-02-27 17:02:14 +01:00
`reset_counter_frequency_id` smallint(6) DEFAULT NULL,
`payment_type_id` smallint(6) DEFAULT NULL,
`gateway_fee_enabled` tinyint(1) NOT NULL DEFAULT '0',
2017-03-23 10:39:44 +01:00
`reset_counter_date` date DEFAULT NULL,
2017-05-18 11:35:48 +02:00
`tax_name1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate1` decimal(13,3) NOT NULL,
`tax_name2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate2` decimal(13,3) NOT NULL,
2017-06-01 18:13:13 +02:00
`quote_design_id` int(10) unsigned NOT NULL DEFAULT '1',
`custom_design2` mediumtext COLLATE utf8_unicode_ci,
`custom_design3` mediumtext COLLATE utf8_unicode_ci,
2017-06-05 15:31:28 +02:00
`analytics_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`credit_number_counter` int(11) DEFAULT '0',
`credit_number_prefix` text COLLATE utf8_unicode_ci,
`credit_number_pattern` text COLLATE utf8_unicode_ci,
`task_rate` decimal(12,4) NOT NULL DEFAULT '0.0000',
2017-12-11 20:33:50 +01:00
`inclusive_taxes` tinyint(1) NOT NULL DEFAULT '0',
2018-01-01 22:17:36 +01:00
`convert_products` tinyint(1) NOT NULL DEFAULT '0',
`enable_reminder4` tinyint(1) NOT NULL DEFAULT '0',
`signature_on_pdf` tinyint(1) NOT NULL DEFAULT '0',
2018-01-23 11:53:42 +01:00
`ubl_email_attachment` tinyint(1) NOT NULL DEFAULT '0',
2018-03-26 09:39:28 +02:00
`auto_archive_invoice` tinyint(1) DEFAULT '0',
`auto_archive_quote` tinyint(1) DEFAULT '0',
`auto_email_invoice` tinyint(1) DEFAULT '1',
`send_item_details` tinyint(1) DEFAULT '0',
2018-04-11 23:21:32 +02:00
`custom_fields` mediumtext COLLATE utf8_unicode_ci,
`background_image_id` int(10) unsigned DEFAULT NULL,
`custom_messages` mediumtext COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `accounts_account_key_unique` (`account_key`),
KEY `accounts_timezone_id_foreign` (`timezone_id`),
KEY `accounts_date_format_id_foreign` (`date_format_id`),
KEY `accounts_datetime_format_id_foreign` (`datetime_format_id`),
KEY `accounts_country_id_foreign` (`country_id`),
KEY `accounts_currency_id_foreign` (`currency_id`),
KEY `accounts_industry_id_foreign` (`industry_id`),
KEY `accounts_size_id_foreign` (`size_id`),
KEY `accounts_invoice_design_id_foreign` (`invoice_design_id`),
KEY `accounts_language_id_foreign` (`language_id`),
KEY `accounts_company_id_foreign` (`company_id`),
CONSTRAINT `accounts_company_id_foreign` FOREIGN KEY (`company_id`) REFERENCES `companies` (`id`) ON DELETE CASCADE,
CONSTRAINT `accounts_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`),
CONSTRAINT `accounts_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
CONSTRAINT `accounts_date_format_id_foreign` FOREIGN KEY (`date_format_id`) REFERENCES `date_formats` (`id`),
CONSTRAINT `accounts_datetime_format_id_foreign` FOREIGN KEY (`datetime_format_id`) REFERENCES `datetime_formats` (`id`),
CONSTRAINT `accounts_industry_id_foreign` FOREIGN KEY (`industry_id`) REFERENCES `industries` (`id`),
CONSTRAINT `accounts_invoice_design_id_foreign` FOREIGN KEY (`invoice_design_id`) REFERENCES `invoice_designs` (`id`),
CONSTRAINT `accounts_language_id_foreign` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`),
CONSTRAINT `accounts_size_id_foreign` FOREIGN KEY (`size_id`) REFERENCES `sizes` (`id`),
CONSTRAINT `accounts_timezone_id_foreign` FOREIGN KEY (`timezone_id`) REFERENCES `timezones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `accounts`
--
LOCK TABLES `accounts` WRITE;
/*!40000 ALTER TABLE `accounts` DISABLE KEYS */;
/*!40000 ALTER TABLE `accounts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `activities`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `activities` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned DEFAULT NULL,
`contact_id` int(10) unsigned DEFAULT NULL,
`payment_id` int(10) unsigned DEFAULT NULL,
`invoice_id` int(10) unsigned DEFAULT NULL,
`credit_id` int(10) unsigned DEFAULT NULL,
`invitation_id` int(10) unsigned DEFAULT NULL,
2018-03-26 09:39:28 +02:00
`task_id` int(10) unsigned DEFAULT NULL,
`json_backup` text COLLATE utf8_unicode_ci,
`activity_type_id` int(11) NOT NULL,
`adjustment` decimal(13,2) DEFAULT NULL,
`balance` decimal(13,2) DEFAULT NULL,
`token_id` int(10) unsigned DEFAULT NULL,
`ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`is_system` tinyint(1) NOT NULL DEFAULT '0',
`expense_id` int(10) unsigned DEFAULT NULL,
`notes` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `activities_account_id_foreign` (`account_id`),
2018-01-01 22:17:36 +01:00
KEY `activities_user_id_index` (`user_id`),
2018-03-26 09:39:28 +02:00
KEY `activities_client_id_foreign` (`client_id`),
KEY `activities_payment_id_index` (`payment_id`),
CONSTRAINT `activities_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `activities_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `activities`
--
LOCK TABLES `activities` WRITE;
/*!40000 ALTER TABLE `activities` DISABLE KEYS */;
/*!40000 ALTER TABLE `activities` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `affiliates`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `affiliates` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`affiliate_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`payment_title` text COLLATE utf8_unicode_ci NOT NULL,
`payment_subtitle` text COLLATE utf8_unicode_ci NOT NULL,
`price` decimal(7,2) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `affiliates_affiliate_key_unique` (`affiliate_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `affiliates`
--
LOCK TABLES `affiliates` WRITE;
/*!40000 ALTER TABLE `affiliates` DISABLE KEYS */;
/*!40000 ALTER TABLE `affiliates` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `bank_accounts`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bank_accounts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`bank_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
2017-07-17 19:15:08 +02:00
`app_version` mediumint(9) NOT NULL DEFAULT '2500',
`ofx_version` mediumint(9) NOT NULL DEFAULT '102',
PRIMARY KEY (`id`),
UNIQUE KEY `bank_accounts_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `bank_accounts_user_id_foreign` (`user_id`),
KEY `bank_accounts_bank_id_foreign` (`bank_id`),
KEY `bank_accounts_public_id_index` (`public_id`),
CONSTRAINT `bank_accounts_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `bank_accounts_bank_id_foreign` FOREIGN KEY (`bank_id`) REFERENCES `banks` (`id`),
CONSTRAINT `bank_accounts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `bank_accounts`
--
LOCK TABLES `bank_accounts` WRITE;
/*!40000 ALTER TABLE `bank_accounts` DISABLE KEYS */;
/*!40000 ALTER TABLE `bank_accounts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `bank_subaccounts`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bank_subaccounts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`bank_account_id` int(10) unsigned NOT NULL,
`account_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`account_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `bank_subaccounts_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `bank_subaccounts_user_id_foreign` (`user_id`),
KEY `bank_subaccounts_bank_account_id_foreign` (`bank_account_id`),
KEY `bank_subaccounts_public_id_index` (`public_id`),
CONSTRAINT `bank_subaccounts_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `bank_subaccounts_bank_account_id_foreign` FOREIGN KEY (`bank_account_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `bank_subaccounts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `bank_subaccounts`
--
LOCK TABLES `bank_subaccounts` WRITE;
/*!40000 ALTER TABLE `bank_subaccounts` DISABLE KEYS */;
/*!40000 ALTER TABLE `bank_subaccounts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `banks`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `banks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`remote_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`bank_library_id` int(11) NOT NULL DEFAULT '1',
`config` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=387 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `banks`
--
LOCK TABLES `banks` WRITE;
/*!40000 ALTER TABLE `banks` DISABLE KEYS */;
INSERT INTO `banks` VALUES (1,'ING DIRECT (Canada)','421',1,'{\"fid\":\"061400152\",\"org\":\"INGDirectCanada\",\"url\":\"https:\\/\\/ofx.ingdirect.ca\"}'),(2,'Safe Credit Union - OFX Beta','422',1,'{\"fid\":\"321173742\",\"org\":\"DI\",\"url\":\"https:\\/\\/ofxcert.diginsite.com\\/cmr\\/cmr.ofx\"}'),(3,'Ascentra Credit Union','423',1,'{\"fid\":\"273973456\",\"org\":\"Alcoa Employees&Community CU\",\"url\":\"https:\\/\\/alc.usersonlnet.com\\/scripts\\/isaofx.dll\"}'),(4,'American Express Card','424',1,'{\"fid\":\"3101\",\"org\":\"AMEX\",\"url\":\"https:\\/\\/online.americanexpress.com\\/myca\\/ofxdl\\/desktop\\/desktopDownload.do?request_type=nl_ofxdownload\"}'),(5,'TD Ameritrade','425',1,'{\"fid\":\"5024\",\"org\":\"ameritrade.com\",\"url\":\"https:\\/\\/ofxs.ameritrade.com\\/cgi-bin\\/apps\\/OFX\"}'),(6,'Truliant FCU','426',1,'{\"fid\":\"253177832\",\"org\":\"DI\",\"url\":\"https:\\/\\/ofxdi.diginsite.com\\/cmr\\/cmr.ofx\"}'),(7,'AT&T Universal Card','427',1,'{\"fid\":\"24909\",\"org\":\"Citigroup\",\"url\":\"https:\\/\\/secureofx2.bankhost.com\\/citi\\/cgi-forte\\/ofx_rt?servicename=ofx_rt&pagename=ofx\"}'),(8,'Bank One','428',1,'{\"fid\":\"5811\",\"org\":\"B1\",\"url\":\"https:\\/\\/onlineofx.chase.com\\/chase.ofx\"}'),(9,'Bank of Stockton','429',1,'{\"fid\":\"3901\",\"org\":\"BOS\",\"url\":\"https:\\/\\/internetbanking.bankofstockton.com\\/scripts\\/serverext.dll\"}'),(10,'Bank of the Cascades','430',1,'{\"fid\":\"4751\",\"org\":\"JackHenry\",\"url\":\"https:\\/\\/directline.netteller.com\"}'),(11,'Centra Credit Union','431',1,'{\"fid\":\"274972883\",\"org\":\"Centra CU\",\"url\":\"https:\\/\\/centralink.org\\/scripts\\/isaofx.dll\"}'),(12,'Centura Bank','432',1,'{\"fid\":\"1901\",\"org\":\"Centura Bank\",\"url\":\"https:\\/\\/www.oasis.cfree.com\\/1901.ofxgp\"}'),(13,'Charles Schwab&Co., INC','433',1,'{\"fid\":\"5104\",\"org\":\"ISC\",\"url\":\"https:\\/\\/ofx.schwab.com\\/cgi_dev\\/ofx_server\"}'),(14,'JPMorgan Chase Bank (Texas)','434',1,'{\"fid\":\"5301\",\"org\":\"Chase Bank of Texas\",\"url\":\"https:\\/\\/www.oasis.cfree.com\\/5301.ofxgp\"}'),(15,'JPMorgan Chase Bank','435',1,'{\"fid\":\"1601\",\"org\":\"Chase Bank\",\"url\":\"https:\\/\\/www.oasis.cfree.com\\/1601.ofxgp\"}'),(16,'Colonial Bank','436',1,'{\"fid\":\"1046\",\"org\":\"Colonial Banc Group\",\"url\":\"https:\\/\\/www.oasis.cfree.com\\/1046.ofxgp\"}'),(17,'Comerica Bank','437',1,'{\"fid\":\"5601\",\"org\":\"Comerica\",\"url\":\"https:\\/\\/www.oasis.cfree.com\\/5601.ofxgp\"}'),(18,'Commerce Bank NJ, PA, NY&DE','438',1,'{\"fid\":\"1001\",\"org\":\"CommerceBank\",\"url\":\"https:\\/\\/www.commerceonlinebanking.com\\/scripts\\/serverext.dll\"}'),(19,'Commerce Bank, NA','439',1,'{\"fid\":\"4001\",\"org\":\"Commerce Bank NA\",\"url\":\"https:\\/\\/www.oasis.cfree.com\\/4001.ofxgp\"}'),(20,'Commercial Federal Bank','440',1,'{\"fid\":\"4801\",\"org\":\"CommercialFederalBank\",\"url\":\"https:\\/\\/www.oasis.cfree.com\\/4801.ofxgp\"}'),(21,'COMSTAR FCU','441',1,'{\"fid\":\"255074988\",\"org\":\"Comstar Federal Credit Union\",\"url\":\"https:\\/\\/pcu.comstarfcu.org\\/scripts\\/isaofx.dll\"}'),(22,'SunTrust','442',1,'{\"fid\":\"2801\",\"org\":\"SunTrust PC Banking\",\"url\":\"https:\\/\\/www.oasis.cfree.com\\/2801.ofxgp\"}'),(23,'Denali Alaskan FCU','443',1,'{\"fid\":\"1\",\"org\":\"Denali Alaskan FCU\",\"url\":\"https:\\/\\/remotebanking.denalifcu.com\\/ofx\\/ofx.dll\"}'),(24,'Discover Card','444',1,'{\"fid\":\"7101\",\"org\":\"Discover Financial Services\",\"url\":\"https:\\/\\/ofx.discovercard.com\"}'),(25,'E*TRADE','446',1,'{\"fid\":\"fldProv_mProvBankId\",\"org\":\"fldProv_mId\",\"url\":\"https:\\/\\/ofx.etrade.com\\/cgi-ofx\\/etradeofx\"}'),(26,'Eastern Bank','447',1,'{\"fid\":\"6201\",\"org\":\"Eastern Bank\",\"url\":\"https:\\/\\/www.oasis.cfree.com\\/6201.ofxgp\"}'),(27,'EDS Credit Union','448',1,'{\"fid\":\"311079474\",\"org\":\"EDS CU\",\"url\":\"https:\\/\\/eds.usersonlnet.com\\/scripts\\/isaofx.dll\"}'),(28,'Fidelity Investments','449',1,'{\"fid\":\"7776\",\"org\":\"fidelity.com\",\"url\":\"https:\\/\\/ofx.fidelity.com\\/ftgw\\/OFX\\/clients\\
/*!40000 ALTER TABLE `banks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `clients`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clients` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`currency_id` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`address1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`address2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`postal_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`country_id` int(10) unsigned DEFAULT NULL,
`work_phone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`private_notes` text COLLATE utf8_unicode_ci,
`balance` decimal(13,2) DEFAULT NULL,
`paid_to_date` decimal(13,2) DEFAULT NULL,
`last_login` timestamp NULL DEFAULT NULL,
`website` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`industry_id` int(10) unsigned DEFAULT NULL,
`size_id` int(10) unsigned DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`payment_terms` int(11) DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
2018-04-11 23:21:32 +02:00
`custom_value1` text COLLATE utf8_unicode_ci,
`custom_value2` text COLLATE utf8_unicode_ci,
`vat_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`id_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`language_id` int(10) unsigned DEFAULT NULL,
2017-03-29 10:46:52 +02:00
`invoice_number_counter` int(11) DEFAULT '1',
`quote_number_counter` int(11) DEFAULT '1',
2017-05-18 11:35:48 +02:00
`public_notes` text COLLATE utf8_unicode_ci,
2017-08-18 11:56:55 +02:00
`credit_number_counter` int(11) DEFAULT '1',
`task_rate` decimal(12,4) NOT NULL DEFAULT '0.0000',
2017-12-11 20:33:50 +01:00
`shipping_address1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`shipping_address2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`shipping_city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`shipping_state` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`shipping_postal_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`shipping_country_id` int(10) unsigned DEFAULT NULL,
`show_tasks_in_portal` tinyint(1) NOT NULL DEFAULT '0',
`send_reminders` tinyint(1) NOT NULL DEFAULT '1',
2018-04-11 23:21:32 +02:00
`custom_messages` mediumtext COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `clients_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `clients_user_id_foreign` (`user_id`),
KEY `clients_country_id_foreign` (`country_id`),
KEY `clients_industry_id_foreign` (`industry_id`),
KEY `clients_size_id_foreign` (`size_id`),
KEY `clients_currency_id_foreign` (`currency_id`),
KEY `clients_account_id_index` (`account_id`),
KEY `clients_public_id_index` (`public_id`),
KEY `clients_language_id_foreign` (`language_id`),
2017-12-11 20:33:50 +01:00
KEY `clients_shipping_country_id_foreign` (`shipping_country_id`),
CONSTRAINT `clients_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `clients_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`),
CONSTRAINT `clients_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
CONSTRAINT `clients_industry_id_foreign` FOREIGN KEY (`industry_id`) REFERENCES `industries` (`id`),
CONSTRAINT `clients_language_id_foreign` FOREIGN KEY (`language_id`) REFERENCES `languages` (`id`),
2017-12-11 20:33:50 +01:00
CONSTRAINT `clients_shipping_country_id_foreign` FOREIGN KEY (`shipping_country_id`) REFERENCES `countries` (`id`),
CONSTRAINT `clients_size_id_foreign` FOREIGN KEY (`size_id`) REFERENCES `sizes` (`id`),
CONSTRAINT `clients_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `clients`
--
LOCK TABLES `clients` WRITE;
/*!40000 ALTER TABLE `clients` DISABLE KEYS */;
/*!40000 ALTER TABLE `clients` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `companies`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `companies` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`plan` enum('pro','enterprise','white_label') COLLATE utf8_unicode_ci DEFAULT NULL,
`plan_term` enum('month','year') COLLATE utf8_unicode_ci DEFAULT NULL,
`plan_started` date DEFAULT NULL,
`plan_paid` date DEFAULT NULL,
`plan_expires` date DEFAULT NULL,
`payment_id` int(10) unsigned DEFAULT NULL,
`trial_started` date DEFAULT NULL,
`trial_plan` enum('pro','enterprise') COLLATE utf8_unicode_ci DEFAULT NULL,
`pending_plan` enum('pro','enterprise','free') COLLATE utf8_unicode_ci DEFAULT NULL,
`pending_term` enum('month','year') COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`plan_price` decimal(7,2) DEFAULT NULL,
`pending_plan_price` decimal(7,2) DEFAULT NULL,
`num_users` smallint(6) NOT NULL DEFAULT '1',
`pending_num_users` smallint(6) NOT NULL DEFAULT '1',
`utm_source` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`utm_medium` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`utm_campaign` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`utm_term` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`utm_content` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`discount` double(8,2) NOT NULL,
`discount_expires` date DEFAULT NULL,
`promo_expires` date DEFAULT NULL,
`bluevine_status` enum('ignored','signed_up') COLLATE utf8_unicode_ci DEFAULT NULL,
2017-05-14 16:21:23 +02:00
`referral_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
2018-03-26 09:39:28 +02:00
KEY `companies_payment_id_index` (`payment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `companies`
--
LOCK TABLES `companies` WRITE;
/*!40000 ALTER TABLE `companies` DISABLE KEYS */;
/*!40000 ALTER TABLE `companies` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `contacts`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `contacts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`is_primary` tinyint(1) NOT NULL DEFAULT '0',
`send_invoice` tinyint(1) NOT NULL DEFAULT '0',
`first_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`phone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_login` timestamp NULL DEFAULT NULL,
`public_id` int(10) unsigned DEFAULT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`confirmation_code` tinyint(1) DEFAULT NULL,
`remember_token` tinyint(1) DEFAULT NULL,
`contact_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`bot_user_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
2018-04-11 23:21:32 +02:00
`custom_value1` text COLLATE utf8_unicode_ci,
`custom_value2` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `contacts_account_id_public_id_unique` (`account_id`,`public_id`),
UNIQUE KEY `contacts_contact_key_unique` (`contact_key`),
KEY `contacts_user_id_foreign` (`user_id`),
KEY `contacts_client_id_index` (`client_id`),
CONSTRAINT `contacts_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE,
CONSTRAINT `contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `contacts`
--
LOCK TABLES `contacts` WRITE;
/*!40000 ALTER TABLE `contacts` DISABLE KEYS */;
/*!40000 ALTER TABLE `contacts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `countries`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `countries` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`capital` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`citizenship` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`country_code` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`currency` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`currency_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`currency_sub_unit` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`full_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`iso_3166_2` varchar(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`iso_3166_3` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`region_code` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`sub_region_code` varchar(3) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`eea` tinyint(1) NOT NULL DEFAULT '0',
`swap_postal_code` tinyint(1) NOT NULL DEFAULT '0',
`swap_currency_symbol` tinyint(1) NOT NULL DEFAULT '0',
`thousand_separator` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`decimal_separator` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=895 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `countries`
--
LOCK TABLES `countries` WRITE;
/*!40000 ALTER TABLE `countries` DISABLE KEYS */;
2018-03-26 09:39:28 +02:00
INSERT INTO `countries` VALUES (4,'Kabul','Afghan','004','afghani','AFN','pul','Islamic Republic of Afghanistan','AF','AFG','Afghanistan','142','034',0,0,0,NULL,NULL),(8,'Tirana','Albanian','008','lek','ALL','(qindar (pl. qindarka))','Republic of Albania','AL','ALB','Albania','150','039',0,0,0,NULL,NULL),(10,'Antartica','of Antartica','010','','','','Antarctica','AQ','ATA','Antarctica','','',0,0,0,NULL,NULL),(12,'Algiers','Algerian','012','Algerian dinar','DZD','centime','Peoples Democratic Republic of Algeria','DZ','DZA','Algeria','002','015',0,0,0,NULL,NULL),(16,'Pago Pago','American Samoan','016','US dollar','USD','cent','Territory of American','AS','ASM','American Samoa','009','061',0,0,0,NULL,NULL),(20,'Andorra la Vella','Andorran','020','euro','EUR','cent','Principality of Andorra','AD','AND','Andorra','150','039',0,0,0,NULL,NULL),(24,'Luanda','Angolan','024','kwanza','AOA','cêntimo','Republic of Angola','AO','AGO','Angola','002','017',0,0,0,NULL,NULL),(28,'St Johns','of Antigua and Barbuda','028','East Caribbean dollar','XCD','cent','Antigua and Barbuda','AG','ATG','Antigua and Barbuda','019','029',0,0,0,NULL,NULL),(31,'Baku','Azerbaijani','031','Azerbaijani manat','AZN','kepik (inv.)','Republic of Azerbaijan','AZ','AZE','Azerbaijan','142','145',0,0,0,NULL,NULL),(32,'Buenos Aires','Argentinian','032','Argentine peso','ARS','centavo','Argentine Republic','AR','ARG','Argentina','019','005',0,1,0,NULL,NULL),(36,'Canberra','Australian','036','Australian dollar','AUD','cent','Commonwealth of Australia','AU','AUS','Australia','009','053',0,0,0,NULL,NULL),(40,'Vienna','Austrian','040','euro','EUR','cent','Republic of Austria','AT','AUT','Austria','150','155',1,1,1,NULL,NULL),(44,'Nassau','Bahamian','044','Bahamian dollar','BSD','cent','Commonwealth of the Bahamas','BS','BHS','Bahamas','019','029',0,0,0,NULL,NULL),(48,'Manama','Bahraini','048','Bahraini dinar','BHD','fils (inv.)','Kingdom of Bahrain','BH','BHR','Bahrain','142','145',0,0,0,NULL,NULL),(50,'Dhaka','Bangladeshi','050','taka (inv.)','BDT','poisha (inv.)','Peoples Republic of Bangladesh','BD','BGD','Bangladesh','142','034',0,0,0,NULL,NULL),(51,'Yerevan','Armenian','051','dram (inv.)','AMD','luma','Republic of Armenia','AM','ARM','Armenia','142','145',0,0,0,NULL,NULL),(52,'Bridgetown','Barbadian','052','Barbados dollar','BBD','cent','Barbados','BB','BRB','Barbados','019','029',0,0,0,NULL,NULL),(56,'Brussels','Belgian','056','euro','EUR','cent','Kingdom of Belgium','BE','BEL','Belgium','150','155',1,1,0,NULL,NULL),(60,'Hamilton','Bermudian','060','Bermuda dollar','BMD','cent','Bermuda','BM','BMU','Bermuda','019','021',0,0,0,NULL,NULL),(64,'Thimphu','Bhutanese','064','ngultrum (inv.)','BTN','chhetrum (inv.)','Kingdom of Bhutan','BT','BTN','Bhutan','142','034',0,0,0,NULL,NULL),(68,'Sucre (BO1)','Bolivian','068','boliviano','BOB','centavo','Plurinational State of Bolivia','BO','BOL','Bolivia, Plurinational State of','019','005',0,0,0,NULL,NULL),(70,'Sarajevo','of Bosnia and Herzegovina','070','convertible mark','BAM','fening','Bosnia and Herzegovina','BA','BIH','Bosnia and Herzegovina','150','039',0,0,0,NULL,NULL),(72,'Gaborone','Botswanan','072','pula (inv.)','BWP','thebe (inv.)','Republic of Botswana','BW','BWA','Botswana','002','018',0,0,0,NULL,NULL),(74,'Bouvet island','of Bouvet island','074','','','','Bouvet Island','BV','BVT','Bouvet Island','','',0,0,0,NULL,NULL),(76,'Brasilia','Brazilian','076','real (pl. reais)','BRL','centavo','Federative Republic of Brazil','BR','BRA','Brazil','019','005',0,0,0,NULL,NULL),(84,'Belmopan','Belizean','084','Belize dollar','BZD','cent','Belize','BZ','BLZ','Belize','019','013',0,0,0,NULL,NULL),(86,'Diego Garcia','Changosian','086','US dollar','USD','cent','British Indian Ocean Territory','IO','IOT','British Indian Ocean Territory','','',0,0,0,NULL,NULL),(90,'Honiara','Solomon Islander','090','Solomon Islands dollar','SBD','cent','Solomon Islands','SB','SLB','Solomon Islands','009','054',0,0,0,NULL,NULL),(92,'Road Town','British Virgin Islander;','092','US dollar','USD','cent','British Virgin Islands','VG','VGB','Vi
/*!40000 ALTER TABLE `countries` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `credits`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `credits` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`amount` decimal(13,2) NOT NULL,
`balance` decimal(13,2) NOT NULL,
`credit_date` date DEFAULT NULL,
`credit_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`private_notes` text COLLATE utf8_unicode_ci NOT NULL,
`public_id` int(10) unsigned NOT NULL,
2017-03-30 10:46:52 +02:00
`public_notes` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `credits_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `credits_user_id_foreign` (`user_id`),
KEY `credits_account_id_index` (`account_id`),
KEY `credits_client_id_index` (`client_id`),
KEY `credits_public_id_index` (`public_id`),
CONSTRAINT `credits_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `credits_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE,
CONSTRAINT `credits_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `credits`
--
LOCK TABLES `credits` WRITE;
/*!40000 ALTER TABLE `credits` DISABLE KEYS */;
/*!40000 ALTER TABLE `credits` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `currencies`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `currencies` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`symbol` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`precision` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`thousand_separator` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`decimal_separator` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`swap_currency_symbol` tinyint(1) NOT NULL DEFAULT '0',
2018-01-01 22:17:36 +01:00
`exchange_rate` decimal(13,4) DEFAULT NULL,
PRIMARY KEY (`id`)
2018-04-11 23:21:32 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `currencies`
--
LOCK TABLES `currencies` WRITE;
/*!40000 ALTER TABLE `currencies` DISABLE KEYS */;
2018-04-11 23:21:32 +02:00
INSERT INTO `currencies` VALUES (1,'US Dollar','$','2',',','.','USD',0,NULL),(2,'British Pound','£','2',',','.','GBP',0,NULL),(3,'Euro','','2','.',',','EUR',0,NULL),(4,'South African Rand','R','2','.',',','ZAR',0,NULL),(5,'Danish Krone','kr','2','.',',','DKK',1,NULL),(6,'Israeli Shekel','NIS ','2',',','.','ILS',0,NULL),(7,'Swedish Krona','kr','2','.',',','SEK',1,NULL),(8,'Kenyan Shilling','KSh ','2',',','.','KES',0,NULL),(9,'Canadian Dollar','C$','2',',','.','CAD',0,NULL),(10,'Philippine Peso','P ','2',',','.','PHP',0,NULL),(11,'Indian Rupee','Rs. ','2',',','.','INR',0,NULL),(12,'Australian Dollar','$','2',',','.','AUD',0,NULL),(13,'Singapore Dollar','','2',',','.','SGD',0,NULL),(14,'Norske Kroner','kr','2','.',',','NOK',1,NULL),(15,'New Zealand Dollar','$','2',',','.','NZD',0,NULL),(16,'Vietnamese Dong','','0','.',',','VND',0,NULL),(17,'Swiss Franc','','2','\'','.','CHF',0,NULL),(18,'Guatemalan Quetzal','Q','2',',','.','GTQ',0,NULL),(19,'Malaysian Ringgit','RM','2',',','.','MYR',0,NULL),(20,'Brazilian Real','R$','2','.',',','BRL',0,NULL),(21,'Thai Baht','','2',',','.','THB',0,NULL),(22,'Nigerian Naira','','2',',','.','NGN',0,NULL),(23,'Argentine Peso','$','2','.',',','ARS',0,NULL),(24,'Bangladeshi Taka','Tk','2',',','.','BDT',0,NULL),(25,'United Arab Emirates Dirham','DH ','2',',','.','AED',0,NULL),(26,'Hong Kong Dollar','','2',',','.','HKD',0,NULL),(27,'Indonesian Rupiah','Rp','2',',','.','IDR',0,NULL),(28,'Mexican Peso','$','2',',','.','MXN',0,NULL),(29,'Egyptian Pound','E£','2',',','.','EGP',0,NULL),(30,'Colombian Peso','$','2','.',',','COP',0,NULL),(31,'West African Franc','CFA ','2',',','.','XOF',0,NULL),(32,'Chinese Renminbi','RMB ','2',',','.','CNY',0,NULL),(33,'Rwandan Franc','RF ','2',',','.','RWF',0,NULL),(34,'Tanzanian Shilling','TSh ','2',',','.','TZS',0,NULL),(35,'Netherlands Antillean Guilder','','2','.',',','ANG',0,NULL),(36,'Trinidad and Tobago Dollar','TT$','2',',','.','TTD',0,NULL),(37,'East Caribbean Dollar','EC$','2',',','.','XCD',0,NULL),(38,'Ghanaian Cedi','','2',',','.','GHS',0,NULL),(39,'Bulgarian Lev','','2',' ','.','BGN',0,NULL),(40,'Aruban Florin','Afl. ','2',' ','.','AWG',0,NULL),(41,'Turkish Lira','TL ','2','.',',','TRY',0,NULL),(42,'Romanian New Leu','','2',',','.','RON',0,NULL),(43,'Croatian Kuna','kn','2','.',',','HRK',0,NULL),(44,'Saudi Riyal','','2',',','.','SAR',0,NULL),(45,'Japanese Yen','¥','0',',','.','JPY',0,NULL),(46,'Maldivian Rufiyaa','','2',',','.','MVR',0,NULL),(47,'Costa Rican Colón','','2',',','.','CRC',0,NULL),(48,'Pakistani Rupee','Rs ','0',',','.','PKR',0,NULL),(49,'Polish Zloty','','2',' ',',','PLN',1,NULL),(50,'Sri Lankan Rupee','LKR','2',',','.','LKR',1,NULL),(51,'Czech Koruna','','2',' ',',','CZK',1,NULL),(52,'Uruguayan Peso','$','2','.',',','UYU',0,NULL),(53,'Namibian Dollar','$','2',',','.','NAD',0,NULL),(54,'Tunisian Dinar','','2',',','.','TND',0,NULL),(55,'Russian Ruble','','2',',','.','RUB',0,NULL),(56,'Mozambican Metical','MT','2','.',',','MZN',1,NULL),(57,'Omani Rial','','2',',','.','OMR',0,NULL),(58,'Ukrainian Hryvnia','','2',',','.','UAH',0,NULL),(59,'Macanese Pataca','MOP$','2',',','.','MOP',0,NULL),(60,'Taiwan New Dollar','NT$','2',',','.','TWD',0,NULL),(61,'Dominican Peso','RD$','2',',','.','DOP',0,NULL),(62,'Chilean Peso','$','0','.',',','CLP',0,NULL),(63,'Icelandic Króna','kr','2','.',',','ISK',1,NULL),(64,'Papua New Guinean Kina','K','2',',','.','PGK',0,NULL),(65,'Jordanian Dinar','','2',',','.','JOD',0,NULL),(66,'Myanmar Kyat','K','2',',','.','MMK',0,NULL),(67,'Peruvian Sol','S/ ','2',',','.','PEN',0,NULL),(68,'Botswana Pula','P','2',',','.','BWP',0,NULL),(69,'Hungarian Forint','Ft','0','.',',','HUF',1,NULL),(70,'Ugandan Shilling','USh ','2',',','.','UGX',0,NULL),(71,'Barbadian Dollar','$','2',',','.','BBD',0,NULL),(72,'Brunei Dollar','B$','2',',','.','BND',0,NULL),(73,'Georgian Lari','','2',' ',',','GEL',0,NULL),(74,'Qatari Riyal','QR','2',',','.','QAR',0,NULL);
/*!40000 ALTER TABLE `currencies` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `date_formats`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `date_formats` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`format` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`picker_format` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`format_moment` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `date_formats`
--
LOCK TABLES `date_formats` WRITE;
/*!40000 ALTER TABLE `date_formats` DISABLE KEYS */;
INSERT INTO `date_formats` VALUES (1,'d/M/Y','dd/M/yyyy','DD/MMM/YYYY'),(2,'d-M-Y','dd-M-yyyy','DD-MMM-YYYY'),(3,'d/F/Y','dd/MM/yyyy','DD/MMMM/YYYY'),(4,'d-F-Y','dd-MM-yyyy','DD-MMMM-YYYY'),(5,'M j, Y','M d, yyyy','MMM D, YYYY'),(6,'F j, Y','MM d, yyyy','MMMM D, YYYY'),(7,'D M j, Y','D MM d, yyyy','ddd MMM Do, YYYY'),(8,'Y-m-d','yyyy-mm-dd','YYYY-MM-DD'),(9,'d-m-Y','dd-mm-yyyy','DD-MM-YYYY'),(10,'m/d/Y','mm/dd/yyyy','MM/DD/YYYY'),(11,'d.m.Y','dd.mm.yyyy','D.MM.YYYY'),(12,'j. M. Y','d. M. yyyy','DD. MMM. YYYY'),(13,'j. F Y','d. MM yyyy','DD. MMMM YYYY');
/*!40000 ALTER TABLE `date_formats` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `datetime_formats`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `datetime_formats` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`format` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`format_moment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `datetime_formats`
--
LOCK TABLES `datetime_formats` WRITE;
/*!40000 ALTER TABLE `datetime_formats` DISABLE KEYS */;
INSERT INTO `datetime_formats` VALUES (1,'d/M/Y g:i a','DD/MMM/YYYY h:mm:ss a'),(2,'d-M-Y g:i a','DD-MMM-YYYY h:mm:ss a'),(3,'d/F/Y g:i a','DD/MMMM/YYYY h:mm:ss a'),(4,'d-F-Y g:i a','DD-MMMM-YYYY h:mm:ss a'),(5,'M j, Y g:i a','MMM D, YYYY h:mm:ss a'),(6,'F j, Y g:i a','MMMM D, YYYY h:mm:ss a'),(7,'D M jS, Y g:i a','ddd MMM Do, YYYY h:mm:ss a'),(8,'Y-m-d g:i a','YYYY-MM-DD h:mm:ss a'),(9,'d-m-Y g:i a','DD-MM-YYYY h:mm:ss a'),(10,'m/d/Y g:i a','MM/DD/YYYY h:mm:ss a'),(11,'d.m.Y g:i a','D.MM.YYYY h:mm:ss a'),(12,'j. M. Y g:i a','DD. MMM. YYYY h:mm:ss a'),(13,'j. F Y g:i a','DD. MMMM YYYY h:mm:ss a');
/*!40000 ALTER TABLE `datetime_formats` ENABLE KEYS */;
UNLOCK TABLES;
2017-04-30 15:37:36 +02:00
--
-- Table structure for table `db_servers`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `db_servers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
2017-05-08 13:19:48 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2017-04-30 15:37:36 +02:00
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `db_servers`
--
LOCK TABLES `db_servers` WRITE;
/*!40000 ALTER TABLE `db_servers` DISABLE KEYS */;
2017-05-08 13:19:48 +02:00
INSERT INTO `db_servers` VALUES (1,'db-ninja-1'),(2,'db-ninja-2');
2017-04-30 15:37:36 +02:00
/*!40000 ALTER TABLE `db_servers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `documents`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `documents` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`public_id` int(10) unsigned DEFAULT NULL,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`invoice_id` int(10) unsigned DEFAULT NULL,
`expense_id` int(10) unsigned DEFAULT NULL,
`path` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`preview` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`type` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`disk` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`hash` varchar(40) COLLATE utf8_unicode_ci NOT NULL,
`size` int(10) unsigned NOT NULL,
`width` int(10) unsigned DEFAULT NULL,
`height` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
2017-08-07 13:12:47 +02:00
`is_default` tinyint(1) DEFAULT '0',
2018-02-13 11:06:50 +01:00
`is_proposal` tinyint(1) NOT NULL DEFAULT '0',
`document_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `documents_account_id_public_id_unique` (`account_id`,`public_id`),
2018-02-13 11:06:50 +01:00
UNIQUE KEY `documents_document_key_unique` (`document_key`),
KEY `documents_user_id_foreign` (`user_id`),
KEY `documents_invoice_id_foreign` (`invoice_id`),
KEY `documents_expense_id_foreign` (`expense_id`),
CONSTRAINT `documents_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `documents_expense_id_foreign` FOREIGN KEY (`expense_id`) REFERENCES `expenses` (`id`) ON DELETE CASCADE,
CONSTRAINT `documents_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE,
CONSTRAINT `documents_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `documents`
--
LOCK TABLES `documents` WRITE;
/*!40000 ALTER TABLE `documents` DISABLE KEYS */;
/*!40000 ALTER TABLE `documents` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `expense_categories`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expense_categories` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `expense_categories_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `expense_categories_account_id_index` (`account_id`),
KEY `expense_categories_public_id_index` (`public_id`),
KEY `expense_categories_user_id_foreign` (`user_id`),
CONSTRAINT `expense_categories_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `expense_categories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `expense_categories`
--
LOCK TABLES `expense_categories` WRITE;
/*!40000 ALTER TABLE `expense_categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `expense_categories` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `expenses`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `expenses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`account_id` int(10) unsigned NOT NULL,
`vendor_id` int(10) unsigned DEFAULT NULL,
`user_id` int(10) unsigned NOT NULL,
`invoice_id` int(10) unsigned DEFAULT NULL,
`client_id` int(10) unsigned DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`amount` decimal(13,2) NOT NULL,
2017-12-11 20:33:50 +01:00
`exchange_rate` decimal(13,4) NOT NULL DEFAULT '1.0000',
`expense_date` date DEFAULT NULL,
`private_notes` text COLLATE utf8_unicode_ci NOT NULL,
`public_notes` text COLLATE utf8_unicode_ci NOT NULL,
`invoice_currency_id` int(10) unsigned NOT NULL,
`should_be_invoiced` tinyint(1) NOT NULL DEFAULT '1',
`public_id` int(10) unsigned NOT NULL,
`transaction_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`bank_id` int(10) unsigned DEFAULT NULL,
`expense_currency_id` int(10) unsigned DEFAULT NULL,
`expense_category_id` int(10) unsigned DEFAULT NULL,
`tax_name1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate1` decimal(13,3) NOT NULL,
`tax_name2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate2` decimal(13,3) NOT NULL,
2017-04-26 08:19:05 +02:00
`payment_type_id` int(10) unsigned DEFAULT NULL,
`payment_date` date DEFAULT NULL,
`transaction_reference` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`invoice_documents` tinyint(1) NOT NULL DEFAULT '1',
2017-06-26 16:23:30 +02:00
`recurring_expense_id` int(10) unsigned DEFAULT NULL,
2018-04-11 23:21:32 +02:00
`custom_value1` text COLLATE utf8_unicode_ci,
`custom_value2` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `expenses_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `expenses_user_id_foreign` (`user_id`),
KEY `expenses_account_id_index` (`account_id`),
KEY `expenses_public_id_index` (`public_id`),
KEY `expenses_expense_currency_id_index` (`expense_currency_id`),
KEY `expenses_invoice_currency_id_foreign` (`invoice_currency_id`),
KEY `expenses_expense_category_id_index` (`expense_category_id`),
2017-04-26 08:19:05 +02:00
KEY `expenses_payment_type_id_foreign` (`payment_type_id`),
2018-03-26 09:39:28 +02:00
KEY `expenses_client_id_foreign` (`client_id`),
CONSTRAINT `expenses_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
2018-03-26 09:39:28 +02:00
CONSTRAINT `expenses_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE,
CONSTRAINT `expenses_expense_category_id_foreign` FOREIGN KEY (`expense_category_id`) REFERENCES `expense_categories` (`id`) ON DELETE CASCADE,
CONSTRAINT `expenses_expense_currency_id_foreign` FOREIGN KEY (`expense_currency_id`) REFERENCES `currencies` (`id`),
CONSTRAINT `expenses_invoice_currency_id_foreign` FOREIGN KEY (`invoice_currency_id`) REFERENCES `currencies` (`id`),
2017-04-26 08:19:05 +02:00
CONSTRAINT `expenses_payment_type_id_foreign` FOREIGN KEY (`payment_type_id`) REFERENCES `payment_types` (`id`),
CONSTRAINT `expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `expenses`
--
LOCK TABLES `expenses` WRITE;
/*!40000 ALTER TABLE `expenses` DISABLE KEYS */;
/*!40000 ALTER TABLE `expenses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `failed_jobs`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `failed_jobs` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`connection` text COLLATE utf8_unicode_ci NOT NULL,
`queue` text COLLATE utf8_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8_unicode_ci NOT NULL,
2018-03-26 09:39:28 +02:00
`exception` longtext COLLATE utf8_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `failed_jobs`
--
LOCK TABLES `failed_jobs` WRITE;
/*!40000 ALTER TABLE `failed_jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `failed_jobs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `fonts`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `fonts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`folder` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`css_stack` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`css_weight` smallint(6) NOT NULL DEFAULT '400',
`google_font` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`normal` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`bold` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`italics` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`bolditalics` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`sort_order` int(10) unsigned NOT NULL DEFAULT '10000',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `fonts`
--
LOCK TABLES `fonts` WRITE;
/*!40000 ALTER TABLE `fonts` DISABLE KEYS */;
INSERT INTO `fonts` VALUES (1,'Roboto','roboto','\'Roboto\', Arial, Helvetica, sans-serif',400,'Roboto:400,700,900,100','Roboto-Regular.ttf','Roboto-Medium.ttf','Roboto-Italic.ttf','Roboto-Italic.ttf',100),(2,'Abril Fatface','abril_fatface','\'Abril Fatface\', Georgia, serif',400,'Abril+Fatface','AbrilFatface-Regular.ttf','AbrilFatface-Regular.ttf','AbrilFatface-Regular.ttf','AbrilFatface-Regular.ttf',200),(3,'Arvo','arvo','\'Arvo\', Georgia, serif',400,'Arvo:400,700','Arvo-Regular.ttf','Arvo-Bold.ttf','Arvo-Italic.ttf','Arvo-Italic.ttf',300),(4,'Josefin Sans','josefin_sans','\'Josefin Sans\', Arial, Helvetica, sans-serif',400,'Josefin Sans:400,700,900,100','JosefinSans-Regular.ttf','JosefinSans-Bold.ttf','JosefinSans-Italic.ttf','JosefinSans-Italic.ttf',400),(5,'Josefin Sans Light','josefin_sans_light','\'Josefin Sans\', Arial, Helvetica, sans-serif',300,'Josefin+Sans:300,700,900,100','JosefinSans-Light.ttf','JosefinSans-SemiBold.ttf','JosefinSans-LightItalic.ttf','JosefinSans-LightItalic.ttf',600),(6,'Josefin Slab','josefin_slab','\'Josefin Slab\', Arial, Helvetica, sans-serif',400,'Josefin Sans:400,700,900,100','JosefinSlab-Regular.ttf','JosefinSlab-Bold.ttf','JosefinSlab-Italic.ttf','JosefinSlab-Italic.ttf',700),(7,'Josefin Slab Light','josefin_slab_light','\'Josefin Slab\', Georgia, serif',300,'Josefin+Sans:400,700,900,100','JosefinSlab-Light.ttf','JosefinSlab-SemiBold.ttf','JosefinSlab-LightItalic.ttf','JosefinSlab-LightItalic.ttf',800),(8,'Open Sans','open_sans','\'Open Sans\', Arial, Helvetica, sans-serif',400,'Open+Sans:400,700,900,100','OpenSans-Regular.ttf','OpenSans-Semibold.ttf','OpenSans-Italic.ttf','OpenSans-Italic.ttf',900),(9,'Open Sans Light','open_sans_light','\'Open Sans\', Arial, Helvetica, sans-serif',300,'Open+Sans:300,700,900,100','OpenSans-Light.ttf','OpenSans-Regular.ttf','OpenSans-LightItalic.ttf','OpenSans-LightItalic.ttf',1000),(10,'PT Sans','pt_sans','\'PT Sans\', Arial, Helvetica, sans-serif',400,'PT+Sans:400,700,900,100','PTSans-Regular.ttf','PTSans-Bold.ttf','PTSans-Italic.ttf','PTSans-Italic.ttf',1100),(11,'PT Serif','pt_serif','\'PT Serif\', Georgia, serif',400,'PT+Serif:400,700,900,100','PTSerif-Regular.ttf','PTSerif-Bold.ttf','PTSerif-Italic.ttf','PTSerif-Italic.ttf',1200),(12,'Raleway','raleway','\'Raleway\', Arial, Helvetica, sans-serif',400,'Raleway:400,700,900,100','Raleway-Regular.ttf','Raleway-Medium.ttf','Raleway-Italic.ttf','Raleway-Italic.ttf',1300),(13,'Raleway Light','raleway_light','\'Raleway\', Arial, Helvetica, sans-serif',300,'Raleway:300,700,900,100','Raleway-Light.ttf','Raleway-Medium.ttf','Raleway-LightItalic.ttf','Raleway-LightItalic.ttf',1400),(14,'Titillium','titillium','\'Titillium Web\', Arial, Helvetica, sans-serif',400,'Titillium+Web:400,700,900,100','TitilliumWeb-Regular.ttf','TitilliumWeb-Bold.ttf','TitilliumWeb-Italic.ttf','TitilliumWeb-Italic.ttf',1500),(15,'Titillium Light','titillium_light','\'Titillium Web\', Arial, Helvetica, sans-serif',300,'Titillium+Web:300,700,900,100','TitilliumWeb-Light.ttf','TitilliumWeb-SemiBold.ttf','TitilliumWeb-LightItalic.ttf','TitilliumWeb-LightItalic.ttf',1600),(16,'Ubuntu','ubuntu','\'Ubuntu\', Arial, Helvetica, sans-serif',400,'Ubuntu:400,700,900,100','Ubuntu-Regular.ttf','Ubuntu-Bold.ttf','Ubuntu-Italic.ttf','Ubuntu-Italic.ttf',1700),(17,'Ubuntu Light','ubuntu_light','\'Ubuntu\', Arial, Helvetica, sans-serif',300,'Ubuntu:200,700,900,100','Ubuntu-Light.ttf','Ubuntu-Medium.ttf','Ubuntu-LightItalic.ttf','Ubuntu-LightItalic.ttf',1800),(18,'UKai - Chinese','ukai','',400,'','UKai.ttf','UKai.ttf','UKai.ttf','UKai.ttf',1800),(19,'GenshinGothic P - Japanese','gensha_gothic_p','',400,'','GenShinGothic-P-Regular.ttf','GenShinGothic-P-Regular.ttf','GenShinGothic-P-Regular.ttf','GenShinGothic-P-Regular.ttf',1800),(20,'GenshinGothic - Japanese','gensha_gothic','',400,'','GenShinGothic-Regular.ttf','GenShinGothic-Regular.ttf','GenShinGothic-Regular.ttf','GenShinGothic-Regular.ttf',1800);
/*!40000 ALTER TABLE `fonts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `frequencies`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `frequencies` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
2018-01-01 22:17:36 +01:00
`date_interval` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
2018-01-01 22:17:36 +01:00
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `frequencies`
--
LOCK TABLES `frequencies` WRITE;
/*!40000 ALTER TABLE `frequencies` DISABLE KEYS */;
2018-01-01 22:17:36 +01:00
INSERT INTO `frequencies` VALUES (1,'Weekly','1 week'),(2,'Two weeks','2 weeks'),(3,'Four weeks','4 weeks'),(4,'Monthly','1 month'),(5,'Two months','2 months'),(6,'Three months','3 months'),(7,'Four months','4 months'),(8,'Six months','6 months'),(9,'Annually','1 year'),(10,'Two years','2 years');
/*!40000 ALTER TABLE `frequencies` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gateway_types`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gateway_types` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
2017-12-11 20:33:50 +01:00
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gateway_types`
--
LOCK TABLES `gateway_types` WRITE;
/*!40000 ALTER TABLE `gateway_types` DISABLE KEYS */;
2017-12-11 20:33:50 +01:00
INSERT INTO `gateway_types` VALUES (1,'credit_card','Credit Card'),(2,'bank_transfer','Bank Transfer'),(3,'paypal','PayPal'),(4,'bitcoin','Bitcoin'),(5,'dwolla','Dwolla'),(6,'custom','Custom'),(7,'alipay','Alipay'),(8,'sofort','Sofort'),(9,'sepa','SEPA'),(10,'gocardless','GoCardless'),(11,'apple_pay','Apple Pay');
/*!40000 ALTER TABLE `gateway_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gateways`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gateways` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`provider` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`visible` tinyint(1) NOT NULL DEFAULT '1',
`payment_library_id` int(10) unsigned NOT NULL DEFAULT '1',
`sort_order` int(10) unsigned NOT NULL DEFAULT '10000',
`recommended` tinyint(1) NOT NULL DEFAULT '0',
`site_url` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`is_offsite` tinyint(1) NOT NULL,
`is_secure` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
KEY `gateways_payment_library_id_foreign` (`payment_library_id`),
CONSTRAINT `gateways_payment_library_id_foreign` FOREIGN KEY (`payment_library_id`) REFERENCES `payment_libraries` (`id`) ON DELETE CASCADE
2018-03-26 09:39:28 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=67 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `gateways`
--
LOCK TABLES `gateways` WRITE;
/*!40000 ALTER TABLE `gateways` DISABLE KEYS */;
2018-04-11 23:21:32 +02:00
INSERT INTO `gateways` VALUES (1,'2018-04-11 18:20:29','2018-04-11 18:20:29','Authorize.Net AIM','AuthorizeNet_AIM',1,1,5,0,NULL,0,0),(2,'2018-04-11 18:20:29','2018-04-11 18:20:29','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2018-04-11 18:20:29','2018-04-11 18:20:29','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2018-04-11 18:20:29','2018-04-11 18:20:29','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2018-04-11 18:20:29','2018-04-11 18:20:29','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2018-04-11 18:20:29','2018-04-11 18:20:29','GoCardless','GoCardless',1,2,10000,0,NULL,1,0),(7,'2018-04-11 18:20:29','2018-04-11 18:20:29','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2018-04-11 18:20:29','2018-04-11 18:20:29','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2018-04-11 18:20:29','2018-04-11 18:20:29','Mollie','Mollie',1,1,8,0,NULL,1,0),(10,'2018-04-11 18:20:29','2018-04-11 18:20:29','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2018-04-11 18:20:29','2018-04-11 18:20:29','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2018-04-11 18:20:29','2018-04-11 18:20:29','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2018-04-11 18:20:29','2018-04-11 18:20:29','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2018-04-11 18:20:29','2018-04-11 18:20:29','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2018-04-11 18:20:29','2018-04-11 18:20:29','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2018-04-11 18:20:29','2018-04-11 18:20:29','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2018-04-11 18:20:29','2018-04-11 18:20:29','PayPal Express','PayPal_Express',1,1,4,0,NULL,1,0),(18,'2018-04-11 18:20:29','2018-04-11 18:20:29','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2018-04-11 18:20:29','2018-04-11 18:20:29','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2018-04-11 18:20:29','2018-04-11 18:20:29','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2018-04-11 18:20:29','2018-04-11 18:20:29','SagePay Server','SagePay_Server',1,1,10000,0,NULL,1,0),(22,'2018-04-11 18:20:29','2018-04-11 18:20:29','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2018-04-11 18:20:29','2018-04-11 18:20:29','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2018-04-11 18:20:29','2018-04-11 18:20:29','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2018-04-11 18:20:29','2018-04-11 18:20:29','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2018-04-11 18:20:29','2018-04-11 18:20:29','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2018-04-11 18:20:29','2018-04-11 18:20:29','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2018-04-11 18:20:29','2018-04-11 18:20:29','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2018-04-11 18:20:29','2018-04-11 18:20:29','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2018-04-11 18:20:29','2018-04-11 18:20:29','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2018-04-11 18:20:29','2018-04-11 18:20:29','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2018-04-11 18:20:29','2018-04-11 18:20:29','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2018-04-11 18:20:29','2018-04-11 18:20:29','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2018-04-11 18:20:29','2018-04-11 18:20:29','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2018-04-11 18:20:29','2018-04-11 18:20:29','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2018-04-11 18:20:29','2018-04-11 18:20:29','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2018-04-11 18:20:29','2018-04-11 18:20:29','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2018-04-11 18:20:29','2018-04-11 18:20:29','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2018-04-11 18:20:29','2018-04-11 18:20:29','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2018-04-11 18:20:29','2018-04-11 18:20:29','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2018-04-11 18:20:29','2018-04-11 18:20:29','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2018-04-11 18:20:29','2018-
/*!40000 ALTER TABLE `gateways` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `industries`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `industries` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
2017-07-04 21:21:29 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `industries`
--
LOCK TABLES `industries` WRITE;
/*!40000 ALTER TABLE `industries` DISABLE KEYS */;
2017-07-04 21:21:29 +02:00
INSERT INTO `industries` VALUES (1,'Accounting & Legal'),(2,'Advertising'),(3,'Aerospace'),(4,'Agriculture'),(5,'Automotive'),(6,'Banking & Finance'),(7,'Biotechnology'),(8,'Broadcasting'),(9,'Business Services'),(10,'Commodities & Chemicals'),(11,'Communications'),(12,'Computers & Hightech'),(13,'Defense'),(14,'Energy'),(15,'Entertainment'),(16,'Government'),(17,'Healthcare & Life Sciences'),(18,'Insurance'),(19,'Manufacturing'),(20,'Marketing'),(21,'Media'),(22,'Nonprofit & Higher Ed'),(23,'Pharmaceuticals'),(24,'Professional Services & Consulting'),(25,'Real Estate'),(26,'Retail & Wholesale'),(27,'Sports'),(28,'Transportation'),(29,'Travel & Luxury'),(30,'Other'),(31,'Photography'),(32,'Construction'),(33,'Restaurant & Catering');
/*!40000 ALTER TABLE `industries` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `invitations`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invitations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`contact_id` int(10) unsigned NOT NULL,
`invoice_id` int(10) unsigned NOT NULL,
`invitation_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`transaction_reference` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`sent_date` timestamp NULL DEFAULT NULL,
`viewed_date` timestamp NULL DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
`opened_date` timestamp NULL DEFAULT NULL,
`message_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email_error` text COLLATE utf8_unicode_ci,
`signature_base64` text COLLATE utf8_unicode_ci,
`signature_date` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `invitations_account_id_public_id_unique` (`account_id`,`public_id`),
UNIQUE KEY `invitations_invitation_key_unique` (`invitation_key`),
KEY `invitations_user_id_foreign` (`user_id`),
KEY `invitations_contact_id_foreign` (`contact_id`),
KEY `invitations_invoice_id_index` (`invoice_id`),
KEY `invitations_public_id_index` (`public_id`),
CONSTRAINT `invitations_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
CONSTRAINT `invitations_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE,
CONSTRAINT `invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `invitations`
--
LOCK TABLES `invitations` WRITE;
/*!40000 ALTER TABLE `invitations` DISABLE KEYS */;
/*!40000 ALTER TABLE `invitations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `invoice_designs`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invoice_designs` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`javascript` mediumtext COLLATE utf8_unicode_ci,
`pdfmake` mediumtext COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`)
2017-06-05 15:31:28 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `invoice_designs`
--
LOCK TABLES `invoice_designs` WRITE;
/*!40000 ALTER TABLE `invoice_designs` DISABLE KEYS */;
2018-04-11 23:21:32 +02:00
INSERT INTO `invoice_designs` VALUES (1,'Clean','var GlobalY=0;//Y position of line at current page\n\n var client = invoice.client;\n var account = invoice.account;\n var currencyId = client.currency_id;\n\n layout.headerRight = 550;\n layout.rowHeight = 15;\n\n doc.setFontSize(9);\n\n if (invoice.image)\n {\n var left = layout.headerRight - invoice.imageWidth;\n doc.addImage(invoice.image, \'JPEG\', layout.marginLeft, 30);\n }\n \n if (!invoice.is_pro && logoImages.imageLogo1)\n {\n pageHeight=820;\n y=pageHeight-logoImages.imageLogoHeight1;\n doc.addImage(logoImages.imageLogo1, \'JPEG\', layout.marginLeft, y, logoImages.imageLogoWidth1, logoImages.imageLogoHeight1);\n }\n\n doc.setFontSize(9);\n SetPdfColor(\'LightBlue\', doc, \'primary\');\n displayAccount(doc, invoice, 220, layout.accountTop, layout);\n\n SetPdfColor(\'LightBlue\', doc, \'primary\');\n doc.setFontSize(\'11\');\n doc.text(50, layout.headerTop, (invoice.is_quote ? invoiceLabels.quote : invoiceLabels.invoice).toUpperCase());\n\n\n SetPdfColor(\'Black\',doc); //set black color\n doc.setFontSize(9);\n\n var invoiceHeight = displayInvoice(doc, invoice, 50, 170, layout);\n var clientHeight = displayClient(doc, invoice, 220, 170, layout);\n var detailsHeight = Math.max(invoiceHeight, clientHeight);\n layout.tableTop = Math.max(layout.tableTop, layout.headerTop + detailsHeight + (3 * layout.rowHeight));\n \n doc.setLineWidth(0.3); \n doc.setDrawColor(200,200,200);\n doc.line(layout.marginLeft - layout.tablePadding, layout.headerTop + 6, layout.marginRight + layout.tablePadding, layout.headerTop + 6);\n doc.line(layout.marginLeft - layout.tablePadding, layout.headerTop + detailsHeight + 14, layout.marginRight + layout.tablePadding, layout.headerTop + detailsHeight + 14);\n\n doc.setFontSize(10);\n doc.setFontType(\'bold\');\n displayInvoiceHeader(doc, invoice, layout);\n var y = displayInvoiceItems(doc, invoice, layout);\n\n doc.setFontSize(9);\n doc.setFontType(\'bold\');\n\n GlobalY=GlobalY+25;\n\n\n doc.setLineWidth(0.3);\n doc.setDrawColor(241,241,241);\n doc.setFillColor(241,241,241);\n var x1 = layout.marginLeft - 12;\n var y1 = GlobalY-layout.tablePadding;\n\n var w2 = 510 + 24;\n var h2 = doc.internal.getFontSize()*3+layout.tablePadding*2;\n\n if (invoice.discount) {\n h2 += doc.internal.getFontSize()*2;\n }\n if (invoice.tax_amount) {\n h2 += doc.internal.getFontSize()*2;\n }\n\n //doc.rect(x1, y1, w2, h2, \'FD\');\n\n doc.setFontSize(9);\n displayNotesAndTerms(doc, layout, invoice, y);\n y += displaySubtotals(doc, layout, invoice, y, layout.unitCostRight);\n\n\n doc.setFontSize(10);\n Msg = invoice.is_quote ? invoiceLabels.total : invoiceLabels.balance_due;\n var TmpMsgX = layout.unitCostRight-(doc.getStringUnitWidth(Msg) * doc.internal.getFontSize());\n \n doc.text(TmpMsgX, y, Msg);\n\n SetPdfColor(\'LightBlue\', doc, \'primary\');\n AmountText = formatMoney(invoice.balance_amount, currencyId);\n headerLeft=layout.headerRight+400;\n var AmountX = layout.lineTotalRight - (doc.getStringUnitWidth(AmountText) * doc.internal.getFontSize());\n doc.text(AmountX, y, AmountText);','{\"content\":[{\"columns\":[{\"image\":\"$accountLogo\",\"fit\":[120,80]},{\"stack\":\"$accountDetails\",\"margin\":[7,0,0,0]},{\"stack\":\"$accountAddress\"}]},{\"text\":\"$entityTypeUC\",\"margin\":[8,30,8,5],\"style\":\"entityTypeLabel\"},{\"table\":{\"headerRows\":1,\"widths\":[\"auto\",\"auto\",\"*\"],\"body\":[[{\"table\":{\"body\":\"$invoiceDetails\"},\"margin\":[0,0,12,0],\"layout\":\"noBorders\"},{\"stack\":\"$clientDetails\"},{\"text\":\"\"}]]},\"layout\":{\"hLineWidth\":\"$firstAndLast:.5\",\"vLineWidth\":\"$none\",\"hLineColor\":\"#D8D8D8\",\"paddingLeft\":\"$amount:8\",\"paddingRight\":\"$amount:8\",\"paddingTop\":\"$amount:6\",\"paddingBottom\":\"$amount:6\"}},{\"style\":\
/*!40000 ALTER TABLE `invoice_designs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `invoice_items`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invoice_items` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`invoice_id` int(10) unsigned NOT NULL,
`product_id` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`product_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`notes` text COLLATE utf8_unicode_ci NOT NULL,
2017-08-16 14:41:47 +02:00
`cost` decimal(15,4) NOT NULL,
2018-01-23 11:53:42 +01:00
`qty` decimal(15,4) DEFAULT '0.0000',
`tax_name1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate1` decimal(13,3) DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
2018-04-11 23:21:32 +02:00
`custom_value1` text COLLATE utf8_unicode_ci,
`custom_value2` text COLLATE utf8_unicode_ci,
`tax_name2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate2` decimal(13,3) NOT NULL,
2017-02-27 17:02:14 +01:00
`invoice_item_type_id` smallint(6) NOT NULL DEFAULT '1',
2018-02-21 19:58:43 +01:00
`discount` decimal(13,2) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `invoice_items_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `invoice_items_product_id_foreign` (`product_id`),
KEY `invoice_items_user_id_foreign` (`user_id`),
KEY `invoice_items_invoice_id_index` (`invoice_id`),
CONSTRAINT `invoice_items_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE,
CONSTRAINT `invoice_items_product_id_foreign` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE,
CONSTRAINT `invoice_items_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `invoice_items`
--
LOCK TABLES `invoice_items` WRITE;
/*!40000 ALTER TABLE `invoice_items` DISABLE KEYS */;
/*!40000 ALTER TABLE `invoice_items` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `invoice_statuses`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invoice_statuses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `invoice_statuses`
--
LOCK TABLES `invoice_statuses` WRITE;
/*!40000 ALTER TABLE `invoice_statuses` DISABLE KEYS */;
INSERT INTO `invoice_statuses` VALUES (1,'Draft'),(2,'Sent'),(3,'Viewed'),(4,'Approved'),(5,'Partial'),(6,'Paid');
/*!40000 ALTER TABLE `invoice_statuses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `invoices`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `invoices` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`client_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`invoice_status_id` int(10) unsigned NOT NULL DEFAULT '1',
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`invoice_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
2018-02-21 19:58:43 +01:00
`discount` decimal(13,2) NOT NULL,
`po_number` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`invoice_date` date DEFAULT NULL,
`due_date` date DEFAULT NULL,
`terms` text COLLATE utf8_unicode_ci NOT NULL,
`public_notes` text COLLATE utf8_unicode_ci NOT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`is_recurring` tinyint(1) NOT NULL DEFAULT '0',
`frequency_id` int(10) unsigned NOT NULL,
`start_date` date DEFAULT NULL,
`end_date` date DEFAULT NULL,
`last_sent_date` date DEFAULT NULL,
`recurring_invoice_id` int(10) unsigned DEFAULT NULL,
`tax_name1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tax_rate1` decimal(13,3) NOT NULL,
`amount` decimal(13,2) NOT NULL,
`balance` decimal(13,2) NOT NULL,
`public_id` int(10) unsigned NOT NULL,
`invoice_design_id` int(10) unsigned NOT NULL DEFAULT '1',
`invoice_type_id` tinyint(1) NOT NULL DEFAULT '0',
`quote_id` int(10) unsigned DEFAULT NULL,
`quote_invoice_id` int(10) unsigned DEFAULT NULL,
`custom_value1` decimal(13,2) NOT NULL DEFAULT '0.00',
`custom_value2` decimal(13,2) NOT NULL DEFAULT '0.00',
`custom_taxes1` tinyint(1) NOT NULL DEFAULT '0',
`custom_taxes2` tinyint(1) NOT NULL DEFAULT '0',
`is_amount_discount` tinyint(1) DEFAULT NULL,
`invoice_footer` text COLLATE utf8_unicode_ci,
`partial` decimal(13,2) DEFAULT NULL,
`has_tasks` tinyint(1) NOT NULL DEFAULT '0',
`auto_bill` tinyint(1) NOT NULL DEFAULT '0',
2018-04-11 23:21:32 +02:00
`custom_text_value1` text COLLATE utf8_unicode_ci,
`custom_text_value2` text COLLATE utf8_unicode_ci,
`has_expenses` tinyint(1) NOT NULL DEFAULT '0',
`tax_name2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate2` decimal(13,3) NOT NULL,
`client_enable_auto_bill` tinyint(1) NOT NULL DEFAULT '0',
`is_public` tinyint(1) NOT NULL DEFAULT '0',
2017-05-18 11:35:48 +02:00
`private_notes` text COLLATE utf8_unicode_ci,
`partial_due_date` date DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `invoices_account_id_public_id_unique` (`account_id`,`public_id`),
UNIQUE KEY `invoices_account_id_invoice_number_unique` (`account_id`,`invoice_number`),
KEY `invoices_user_id_foreign` (`user_id`),
KEY `invoices_invoice_status_id_foreign` (`invoice_status_id`),
KEY `invoices_client_id_index` (`client_id`),
KEY `invoices_account_id_index` (`account_id`),
KEY `invoices_recurring_invoice_id_index` (`recurring_invoice_id`),
KEY `invoices_public_id_index` (`public_id`),
KEY `invoices_invoice_design_id_foreign` (`invoice_design_id`),
CONSTRAINT `invoices_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `invoices_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE,
CONSTRAINT `invoices_invoice_design_id_foreign` FOREIGN KEY (`invoice_design_id`) REFERENCES `invoice_designs` (`id`),
CONSTRAINT `invoices_invoice_status_id_foreign` FOREIGN KEY (`invoice_status_id`) REFERENCES `invoice_statuses` (`id`),
CONSTRAINT `invoices_recurring_invoice_id_foreign` FOREIGN KEY (`recurring_invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE,
CONSTRAINT `invoices_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `invoices`
--
LOCK TABLES `invoices` WRITE;
/*!40000 ALTER TABLE `invoices` DISABLE KEYS */;
/*!40000 ALTER TABLE `invoices` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `jobs`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `jobs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`queue` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8_unicode_ci NOT NULL,
`attempts` tinyint(3) unsigned NOT NULL,
`reserved_at` int(10) unsigned DEFAULT NULL,
`available_at` int(10) unsigned NOT NULL,
`created_at` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
2018-03-26 09:39:28 +02:00
KEY `jobs_queue_reserved_at_index` (`queue`,`reserved_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `jobs`
--
LOCK TABLES `jobs` WRITE;
/*!40000 ALTER TABLE `jobs` DISABLE KEYS */;
/*!40000 ALTER TABLE `jobs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `languages`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `languages` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
2017-09-10 08:58:14 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `languages`
--
LOCK TABLES `languages` WRITE;
/*!40000 ALTER TABLE `languages` DISABLE KEYS */;
2018-02-21 19:58:43 +01:00
INSERT INTO `languages` VALUES (1,'English','en'),(2,'Italian','it'),(3,'German','de'),(4,'French','fr'),(5,'Portuguese - Brazilian','pt_BR'),(6,'Dutch','nl'),(7,'Spanish','es'),(8,'Norwegian','nb_NO'),(9,'Danish','da'),(10,'Japanese','ja'),(11,'Swedish','sv'),(12,'Spanish - Spain','es_ES'),(13,'French - Canada','fr_CA'),(14,'Lithuanian','lt'),(15,'Polish','pl'),(16,'Czech','cs'),(17,'Croatian','hr'),(18,'Albanian','sq'),(19,'Greek','el'),(20,'English - United Kingdom','en_GB'),(21,'Portuguese - Portugal','pt_PT'),(22,'Slovenian','sl'),(23,'Finnish','fi'),(24,'Romanian','ro'),(25,'Turkish - Turkey','tr_TR'),(26,'Thai','th');
/*!40000 ALTER TABLE `languages` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `licenses`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `licenses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`affiliate_id` int(10) unsigned NOT NULL,
`first_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`license_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`is_claimed` tinyint(1) NOT NULL,
`transaction_reference` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`product_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `licenses_license_key_unique` (`license_key`),
KEY `licenses_affiliate_id_foreign` (`affiliate_id`),
CONSTRAINT `licenses_affiliate_id_foreign` FOREIGN KEY (`affiliate_id`) REFERENCES `affiliates` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `licenses`
--
LOCK TABLES `licenses` WRITE;
/*!40000 ALTER TABLE `licenses` DISABLE KEYS */;
/*!40000 ALTER TABLE `licenses` ENABLE KEYS */;
UNLOCK TABLES;
2017-05-08 13:19:48 +02:00
--
-- Table structure for table `lookup_account_tokens`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lookup_account_tokens` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`lookup_account_id` int(10) unsigned NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `lookup_tokens_token_unique` (`token`),
KEY `lookup_tokens_lookup_account_id_index` (`lookup_account_id`),
CONSTRAINT `lookup_tokens_lookup_account_id_foreign` FOREIGN KEY (`lookup_account_id`) REFERENCES `lookup_accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `lookup_account_tokens`
--
LOCK TABLES `lookup_account_tokens` WRITE;
/*!40000 ALTER TABLE `lookup_account_tokens` DISABLE KEYS */;
/*!40000 ALTER TABLE `lookup_account_tokens` ENABLE KEYS */;
UNLOCK TABLES;
2017-04-30 15:37:36 +02:00
--
-- Table structure for table `lookup_accounts`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lookup_accounts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`lookup_company_id` int(10) unsigned NOT NULL,
`account_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
2017-12-11 20:33:50 +01:00
`subdomain` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
2017-04-30 15:37:36 +02:00
PRIMARY KEY (`id`),
2017-05-08 13:19:48 +02:00
UNIQUE KEY `lookup_accounts_account_key_unique` (`account_key`),
2017-12-11 20:33:50 +01:00
UNIQUE KEY `lookup_accounts_subdomain_unique` (`subdomain`),
2017-04-30 15:37:36 +02:00
KEY `lookup_accounts_lookup_company_id_index` (`lookup_company_id`),
CONSTRAINT `lookup_accounts_lookup_company_id_foreign` FOREIGN KEY (`lookup_company_id`) REFERENCES `lookup_companies` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `lookup_accounts`
--
LOCK TABLES `lookup_accounts` WRITE;
/*!40000 ALTER TABLE `lookup_accounts` DISABLE KEYS */;
/*!40000 ALTER TABLE `lookup_accounts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `lookup_companies`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lookup_companies` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`db_server_id` int(10) unsigned NOT NULL,
2017-05-08 13:19:48 +02:00
`company_id` int(10) unsigned NOT NULL,
2017-04-30 15:37:36 +02:00
PRIMARY KEY (`id`),
2017-05-08 13:19:48 +02:00
UNIQUE KEY `lookup_companies_db_server_id_company_id_unique` (`db_server_id`,`company_id`),
KEY `lookup_companies_company_id_index` (`company_id`),
2017-04-30 15:37:36 +02:00
CONSTRAINT `lookup_companies_db_server_id_foreign` FOREIGN KEY (`db_server_id`) REFERENCES `db_servers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `lookup_companies`
--
LOCK TABLES `lookup_companies` WRITE;
/*!40000 ALTER TABLE `lookup_companies` DISABLE KEYS */;
/*!40000 ALTER TABLE `lookup_companies` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `lookup_contacts`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lookup_contacts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`lookup_account_id` int(10) unsigned NOT NULL,
`contact_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
2017-05-08 13:19:48 +02:00
UNIQUE KEY `lookup_contacts_contact_key_unique` (`contact_key`),
2017-04-30 15:37:36 +02:00
KEY `lookup_contacts_lookup_account_id_index` (`lookup_account_id`),
CONSTRAINT `lookup_contacts_lookup_account_id_foreign` FOREIGN KEY (`lookup_account_id`) REFERENCES `lookup_accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `lookup_contacts`
--
LOCK TABLES `lookup_contacts` WRITE;
/*!40000 ALTER TABLE `lookup_contacts` DISABLE KEYS */;
/*!40000 ALTER TABLE `lookup_contacts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `lookup_invitations`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lookup_invitations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`lookup_account_id` int(10) unsigned NOT NULL,
`invitation_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
2017-05-08 13:19:48 +02:00
`message_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
2017-04-30 15:37:36 +02:00
PRIMARY KEY (`id`),
2017-05-08 13:19:48 +02:00
UNIQUE KEY `lookup_invitations_invitation_key_unique` (`invitation_key`),
UNIQUE KEY `lookup_invitations_message_id_unique` (`message_id`),
2017-04-30 15:37:36 +02:00
KEY `lookup_invitations_lookup_account_id_index` (`lookup_account_id`),
CONSTRAINT `lookup_invitations_lookup_account_id_foreign` FOREIGN KEY (`lookup_account_id`) REFERENCES `lookup_accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `lookup_invitations`
--
LOCK TABLES `lookup_invitations` WRITE;
/*!40000 ALTER TABLE `lookup_invitations` DISABLE KEYS */;
/*!40000 ALTER TABLE `lookup_invitations` ENABLE KEYS */;
UNLOCK TABLES;
2018-02-12 09:43:31 +01:00
--
-- Table structure for table `lookup_proposal_invitations`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lookup_proposal_invitations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`lookup_account_id` int(10) unsigned NOT NULL,
`invitation_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`message_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `lookup_proposal_invitations_invitation_key_unique` (`invitation_key`),
UNIQUE KEY `lookup_proposal_invitations_message_id_unique` (`message_id`),
KEY `lookup_proposal_invitations_lookup_account_id_index` (`lookup_account_id`),
CONSTRAINT `lookup_proposal_invitations_lookup_account_id_foreign` FOREIGN KEY (`lookup_account_id`) REFERENCES `lookup_accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `lookup_proposal_invitations`
--
LOCK TABLES `lookup_proposal_invitations` WRITE;
/*!40000 ALTER TABLE `lookup_proposal_invitations` DISABLE KEYS */;
/*!40000 ALTER TABLE `lookup_proposal_invitations` ENABLE KEYS */;
UNLOCK TABLES;
2017-04-30 15:37:36 +02:00
--
-- Table structure for table `lookup_users`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lookup_users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`lookup_account_id` int(10) unsigned NOT NULL,
2017-05-08 13:19:48 +02:00
`email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`confirmation_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`user_id` int(10) unsigned NOT NULL,
2017-05-14 16:21:23 +02:00
`oauth_user_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`referral_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
2017-04-30 15:37:36 +02:00
PRIMARY KEY (`id`),
2017-05-08 13:19:48 +02:00
UNIQUE KEY `lookup_users_lookup_account_id_user_id_unique` (`lookup_account_id`,`user_id`),
UNIQUE KEY `lookup_users_email_unique` (`email`),
UNIQUE KEY `lookup_users_confirmation_code_unique` (`confirmation_code`),
2017-05-14 16:21:23 +02:00
UNIQUE KEY `lookup_users_oauth_user_key_unique` (`oauth_user_key`),
UNIQUE KEY `lookup_users_referral_code_unique` (`referral_code`),
2017-04-30 15:37:36 +02:00
KEY `lookup_users_lookup_account_id_index` (`lookup_account_id`),
2017-05-08 13:19:48 +02:00
KEY `lookup_users_user_id_index` (`user_id`),
2017-04-30 15:37:36 +02:00
CONSTRAINT `lookup_users_lookup_account_id_foreign` FOREIGN KEY (`lookup_account_id`) REFERENCES `lookup_accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `lookup_users`
--
LOCK TABLES `lookup_users` WRITE;
/*!40000 ALTER TABLE `lookup_users` DISABLE KEYS */;
/*!40000 ALTER TABLE `lookup_users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `migrations`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
2017-12-11 20:33:50 +01:00
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
2017-12-11 20:33:50 +01:00
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
2018-04-11 23:21:32 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=108 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `migrations`
--
LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
2018-04-11 23:21:32 +02:00
INSERT INTO `migrations` VALUES (1,'2013_11_05_180133_confide_setup_users_table',1),(2,'2013_11_28_195703_setup_countries_table',1),(3,'2014_02_13_151500_add_cascase_drops',1),(4,'2014_02_19_151817_add_support_for_invoice_designs',1),(5,'2014_03_03_155556_add_phone_to_account',1),(6,'2014_03_19_201454_add_language_support',1),(7,'2014_03_20_200300_create_payment_libraries',1),(8,'2014_03_23_051736_enable_forcing_jspdf',1),(9,'2014_03_25_102200_add_sort_and_recommended_to_gateways',1),(10,'2014_04_03_191105_add_pro_plan',1),(11,'2014_04_17_100523_add_remember_token',1),(12,'2014_04_17_145108_add_custom_fields',1),(13,'2014_04_23_170909_add_products_settings',1),(14,'2014_04_29_174315_add_advanced_settings',1),(15,'2014_05_17_175626_add_quotes',1),(16,'2014_06_17_131940_add_accepted_credit_cards_to_account_gateways',1),(17,'2014_07_13_142654_one_click_install',1),(18,'2014_07_17_205900_support_hiding_quantity',1),(19,'2014_07_24_171214_add_zapier_support',1),(20,'2014_10_01_141248_add_company_vat_number',1),(21,'2014_10_05_141856_track_last_seen_message',1),(22,'2014_10_06_103529_add_timesheets',1),(23,'2014_10_06_195330_add_invoice_design_table',1),(24,'2014_10_13_054100_add_invoice_number_settings',1),(25,'2014_10_14_225227_add_danish_translation',1),(26,'2014_10_22_174452_add_affiliate_price',1),(27,'2014_10_30_184126_add_company_id_number',1),(28,'2014_11_04_200406_allow_null_client_currency',1),(29,'2014_12_03_154119_add_discount_type',1),(30,'2015_02_12_102940_add_email_templates',1),(31,'2015_02_17_131714_support_token_billing',1),(32,'2015_02_27_081836_add_invoice_footer',1),(33,'2015_03_03_140259_add_tokens',1),(34,'2015_03_09_151011_add_ip_to_activity',1),(35,'2015_03_15_174122_add_pdf_email_attachment_option',1),(36,'2015_03_30_100000_create_password_resets_table',1),(37,'2015_04_12_093447_add_sv_language',1),(38,'2015_04_13_100333_add_notify_approved',1),(39,'2015_04_16_122647_add_partial_amount_to_invoices',1),(40,'2015_05_21_184104_add_font_size',1),(41,'2015_05_27_121828_add_tasks',1),(42,'2015_05_27_170808_add_custom_invoice_labels',1),(43,'2015_06_09_134208_add_has_tasks_to_invoices',1),(44,'2015_06_14_093410_enable_resuming_tasks',1),(45,'2015_06_14_173025_multi_company_support',1),(46,'2015_07_07_160257_support_locking_account',1),(47,'2015_07_08_114333_simplify_tasks',1),(48,'2015_07_19_081332_add_custom_design',1),(49,'2015_07_27_183830_add_pdfmake_support',1),(50,'2015_08_13_084041_add_formats_to_datetime_formats_table',1),(51,'2015_09_04_080604_add_swap_postal_code',1),(52,'2015_09_07_135935_add_account_domain',1),(53,'2015_09_10_185135_add_reminder_emails',1),(54,'2015_10_07_135651_add_social_login',1),(55,'2015_10_21_075058_add_default_tax_rates',1),(56,'2015_10_21_185724_add_invoice_number_pattern',1),(57,'2015_10_27_180214_add_is_system_to_activities',1),(58,'2015_10_29_133747_add_default_quote_terms',1),(59,'2015_11_01_080417_encrypt_tokens',1),(60,'2015_11_03_181318_improve_currency_localization',1),(61,'2015_11_30_133206_add_email_designs',1),(62,'2015_12_27_154513_add_reminder_settings',1),(63,'2015_12_30_042035_add_client_view_css',1),(64,'2016_01_04_175228_create_vendors_table',1),(65,'2016_01_06_153144_add_invoice_font_support',1),(66,'2016_01_17_155725_add_quote_to_invoice_option',1),(67,'2016_01_18_195351_add_bank_accounts',1),(68,'2016_01_24_112646_add_bank_subaccounts',1),(69,'2016_01_27_173015_add_header_footer_option',1),(70,'2016_02_01_135956_add_source_currency_to_expenses',1),(71,'2016_02_25_152948_add_client_password',1),(72,'2016_02_28_081424_add_custom_invoice_fields',1),(73,'2016_03_14_066181_add_user_permissions',1),(74,'2016_03_14_214710_add_support_three_decimal_taxes',1),(75,'2016_03_22_168362_add_documents',1),(76,'2016_03_23_215049_support_multiple_tax_rates',1),(77,'2016_04_16_103943_enterprise_plan',1),(78,'2016_04_18_174135_add_page_size',1),(79,'2016_04_23_182223_payments_changes',1),(80,'2016_05_16_102925_add_swap_currency_symbol_to_currency',1),(81,'2016_05_18_085739_add_invoice_type_support',1),(82,'2016_05_24_164847_wepay_ach',1),(83,'2016_07_08_083802_support_n
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `password_resets`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `password_resets`
--
LOCK TABLES `password_resets` WRITE;
/*!40000 ALTER TABLE `password_resets` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_resets` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_libraries`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_libraries` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`visible` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_libraries`
--
LOCK TABLES `payment_libraries` WRITE;
/*!40000 ALTER TABLE `payment_libraries` DISABLE KEYS */;
2018-04-11 23:21:32 +02:00
INSERT INTO `payment_libraries` VALUES (1,'2018-04-11 18:20:27','2018-04-11 18:20:27','Omnipay',1),(2,'2018-04-11 18:20:27','2018-04-11 18:20:27','PHP-Payments [Deprecated]',1);
/*!40000 ALTER TABLE `payment_libraries` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_methods`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_methods` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`contact_id` int(10) unsigned DEFAULT NULL,
2017-03-20 09:20:43 +01:00
`account_gateway_token_id` int(10) unsigned DEFAULT NULL,
`payment_type_id` int(10) unsigned NOT NULL,
`source_reference` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`routing_number` int(10) unsigned DEFAULT NULL,
`last4` smallint(5) unsigned DEFAULT NULL,
`expiration` date DEFAULT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`currency_id` int(10) unsigned DEFAULT NULL,
`status` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
`bank_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `payment_methods_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `payment_methods_public_id_index` (`public_id`),
KEY `payment_methods_user_id_foreign` (`user_id`),
KEY `payment_methods_contact_id_foreign` (`contact_id`),
KEY `payment_methods_payment_type_id_foreign` (`payment_type_id`),
KEY `payment_methods_currency_id_foreign` (`currency_id`),
2017-03-20 09:20:43 +01:00
KEY `payment_methods_account_gateway_token_id_foreign` (`account_gateway_token_id`),
CONSTRAINT `payment_methods_account_gateway_token_id_foreign` FOREIGN KEY (`account_gateway_token_id`) REFERENCES `account_gateway_tokens` (`id`) ON DELETE CASCADE,
CONSTRAINT `payment_methods_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `payment_methods_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
CONSTRAINT `payment_methods_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
CONSTRAINT `payment_methods_payment_type_id_foreign` FOREIGN KEY (`payment_type_id`) REFERENCES `payment_types` (`id`),
CONSTRAINT `payment_methods_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_methods`
--
LOCK TABLES `payment_methods` WRITE;
/*!40000 ALTER TABLE `payment_methods` DISABLE KEYS */;
/*!40000 ALTER TABLE `payment_methods` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_statuses`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_statuses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_statuses`
--
LOCK TABLES `payment_statuses` WRITE;
/*!40000 ALTER TABLE `payment_statuses` DISABLE KEYS */;
INSERT INTO `payment_statuses` VALUES (1,'Pending'),(2,'Voided'),(3,'Failed'),(4,'Completed'),(5,'Partially Refunded'),(6,'Refunded');
/*!40000 ALTER TABLE `payment_statuses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_terms`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_terms` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`num_days` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`user_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`public_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `payment_terms_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `payment_terms_public_id_index` (`public_id`)
2018-03-26 09:39:28 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_terms`
--
LOCK TABLES `payment_terms` WRITE;
/*!40000 ALTER TABLE `payment_terms` DISABLE KEYS */;
2018-04-11 23:21:32 +02:00
INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2018-04-11 18:20:27','2018-04-11 18:20:27',NULL,0,0,1),(2,10,'Net 10','2018-04-11 18:20:27','2018-04-11 18:20:27',NULL,0,0,2),(3,14,'Net 14','2018-04-11 18:20:27','2018-04-11 18:20:27',NULL,0,0,3),(4,15,'Net 15','2018-04-11 18:20:27','2018-04-11 18:20:27',NULL,0,0,4),(5,30,'Net 30','2018-04-11 18:20:27','2018-04-11 18:20:27',NULL,0,0,5),(6,60,'Net 60','2018-04-11 18:20:27','2018-04-11 18:20:27',NULL,0,0,6),(7,90,'Net 90','2018-04-11 18:20:27','2018-04-11 18:20:27',NULL,0,0,7),(8,-1,'Net 0','2018-04-11 18:20:30','2018-04-11 18:20:30',NULL,0,0,0);
/*!40000 ALTER TABLE `payment_terms` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_types`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payment_types` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`gateway_type_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `payment_types_gateway_type_id_foreign` (`gateway_type_id`),
CONSTRAINT `payment_types_gateway_type_id_foreign` FOREIGN KEY (`gateway_type_id`) REFERENCES `gateway_types` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payment_types`
--
LOCK TABLES `payment_types` WRITE;
/*!40000 ALTER TABLE `payment_types` DISABLE KEYS */;
INSERT INTO `payment_types` VALUES (1,'Apply Credit',NULL),(2,'Bank Transfer',2),(3,'Cash',NULL),(4,'Debit',1),(5,'ACH',2),(6,'Visa Card',1),(7,'MasterCard',1),(8,'American Express',1),(9,'Discover Card',1),(10,'Diners Card',1),(11,'EuroCard',1),(12,'Nova',1),(13,'Credit Card Other',1),(14,'PayPal',3),(15,'Google Wallet',NULL),(16,'Check',NULL),(17,'Carte Blanche',1),(18,'UnionPay',1),(19,'JCB',1),(20,'Laser',1),(21,'Maestro',1),(22,'Solo',1),(23,'Switch',1),(24,'iZettle',1),(25,'Swish',2),(26,'Venmo',NULL),(27,'Money Order',NULL),(28,'Alipay',7),(29,'Sofort',8),(30,'SEPA',9),(31,'GoCardless',10),(32,'Bitcoin',4);
/*!40000 ALTER TABLE `payment_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payments`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `payments` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`invoice_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned NOT NULL,
`contact_id` int(10) unsigned DEFAULT NULL,
`invitation_id` int(10) unsigned DEFAULT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`account_gateway_id` int(10) unsigned DEFAULT NULL,
`payment_type_id` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`amount` decimal(13,2) NOT NULL,
`payment_date` date DEFAULT NULL,
`transaction_reference` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`payer_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
`refunded` decimal(13,2) NOT NULL,
`payment_status_id` int(10) unsigned NOT NULL DEFAULT '4',
`routing_number` int(10) unsigned DEFAULT NULL,
`last4` smallint(5) unsigned DEFAULT NULL,
`expiration` date DEFAULT NULL,
`gateway_error` text COLLATE utf8_unicode_ci,
`email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`payment_method_id` int(10) unsigned DEFAULT NULL,
`bank_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`credit_ids` text COLLATE utf8_unicode_ci,
2017-05-18 11:35:48 +02:00
`private_notes` text COLLATE utf8_unicode_ci,
2017-12-11 20:33:50 +01:00
`exchange_rate` decimal(13,4) NOT NULL DEFAULT '1.0000',
`exchange_currency_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `payments_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `payments_contact_id_foreign` (`contact_id`),
KEY `payments_account_gateway_id_foreign` (`account_gateway_id`),
KEY `payments_user_id_foreign` (`user_id`),
KEY `payments_payment_type_id_foreign` (`payment_type_id`),
KEY `payments_invoice_id_index` (`invoice_id`),
KEY `payments_account_id_index` (`account_id`),
KEY `payments_client_id_index` (`client_id`),
KEY `payments_public_id_index` (`public_id`),
KEY `payments_payment_status_id_foreign` (`payment_status_id`),
KEY `payments_payment_method_id_foreign` (`payment_method_id`),
CONSTRAINT `payments_account_gateway_id_foreign` FOREIGN KEY (`account_gateway_id`) REFERENCES `account_gateways` (`id`) ON DELETE CASCADE,
CONSTRAINT `payments_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `payments_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE,
CONSTRAINT `payments_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
CONSTRAINT `payments_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE,
2017-03-20 09:20:43 +01:00
CONSTRAINT `payments_payment_method_id_foreign` FOREIGN KEY (`payment_method_id`) REFERENCES `payment_methods` (`id`) ON DELETE CASCADE,
CONSTRAINT `payments_payment_status_id_foreign` FOREIGN KEY (`payment_status_id`) REFERENCES `payment_statuses` (`id`),
CONSTRAINT `payments_payment_type_id_foreign` FOREIGN KEY (`payment_type_id`) REFERENCES `payment_types` (`id`),
CONSTRAINT `payments_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `payments`
--
LOCK TABLES `payments` WRITE;
/*!40000 ALTER TABLE `payments` DISABLE KEYS */;
/*!40000 ALTER TABLE `payments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `products`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`product_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`notes` text COLLATE utf8_unicode_ci NOT NULL,
2017-08-16 14:41:47 +02:00
`cost` decimal(15,4) NOT NULL,
2018-01-23 11:53:42 +01:00
`qty` decimal(15,4) DEFAULT '0.0000',
`public_id` int(10) unsigned NOT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
2018-04-11 23:21:32 +02:00
`custom_value1` text COLLATE utf8_unicode_ci,
`custom_value2` text COLLATE utf8_unicode_ci,
2017-05-18 11:35:48 +02:00
`tax_name1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate1` decimal(13,3) NOT NULL,
`tax_name2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate2` decimal(13,3) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `products_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `products_user_id_foreign` (`user_id`),
KEY `products_account_id_index` (`account_id`),
CONSTRAINT `products_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `products_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `products`
--
LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `projects`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `projects` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`public_id` int(10) unsigned NOT NULL,
`task_rate` decimal(12,4) NOT NULL DEFAULT '0.0000',
2018-01-01 22:17:36 +01:00
`due_date` date DEFAULT NULL,
`private_notes` text COLLATE utf8_unicode_ci,
`budgeted_hours` double(8,2) NOT NULL,
2018-04-11 23:21:32 +02:00
`custom_value1` text COLLATE utf8_unicode_ci,
`custom_value2` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `projects_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `projects_user_id_foreign` (`user_id`),
KEY `projects_account_id_index` (`account_id`),
KEY `projects_client_id_index` (`client_id`),
KEY `projects_public_id_index` (`public_id`),
CONSTRAINT `projects_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `projects_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE,
CONSTRAINT `projects_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `projects`
--
LOCK TABLES `projects` WRITE;
/*!40000 ALTER TABLE `projects` DISABLE KEYS */;
/*!40000 ALTER TABLE `projects` ENABLE KEYS */;
UNLOCK TABLES;
2018-02-12 09:43:31 +01:00
--
-- Table structure for table `proposal_categories`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `proposal_categories` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`public_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `proposal_categories_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `proposal_categories_user_id_foreign` (`user_id`),
KEY `proposal_categories_public_id_index` (`public_id`),
CONSTRAINT `proposal_categories_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `proposal_categories_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `proposal_categories`
--
LOCK TABLES `proposal_categories` WRITE;
/*!40000 ALTER TABLE `proposal_categories` DISABLE KEYS */;
/*!40000 ALTER TABLE `proposal_categories` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `proposal_invitations`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `proposal_invitations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`contact_id` int(10) unsigned NOT NULL,
`proposal_id` int(10) unsigned NOT NULL,
`invitation_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`sent_date` timestamp NULL DEFAULT NULL,
`viewed_date` timestamp NULL DEFAULT NULL,
`opened_date` timestamp NULL DEFAULT NULL,
`message_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email_error` text COLLATE utf8_unicode_ci,
`public_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `proposal_invitations_account_id_public_id_unique` (`account_id`,`public_id`),
UNIQUE KEY `proposal_invitations_invitation_key_unique` (`invitation_key`),
KEY `proposal_invitations_user_id_foreign` (`user_id`),
KEY `proposal_invitations_contact_id_foreign` (`contact_id`),
KEY `proposal_invitations_proposal_id_index` (`proposal_id`),
KEY `proposal_invitations_public_id_index` (`public_id`),
CONSTRAINT `proposal_invitations_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
CONSTRAINT `proposal_invitations_proposal_id_foreign` FOREIGN KEY (`proposal_id`) REFERENCES `proposals` (`id`) ON DELETE CASCADE,
CONSTRAINT `proposal_invitations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `proposal_invitations`
--
LOCK TABLES `proposal_invitations` WRITE;
/*!40000 ALTER TABLE `proposal_invitations` DISABLE KEYS */;
/*!40000 ALTER TABLE `proposal_invitations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `proposal_snippets`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `proposal_snippets` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`proposal_category_id` int(10) unsigned DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`icon` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`private_notes` text COLLATE utf8_unicode_ci NOT NULL,
`html` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`css` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`public_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `proposal_snippets_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `proposal_snippets_user_id_foreign` (`user_id`),
KEY `proposal_snippets_public_id_index` (`public_id`),
CONSTRAINT `proposal_snippets_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `proposal_snippets_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `proposal_snippets`
--
LOCK TABLES `proposal_snippets` WRITE;
/*!40000 ALTER TABLE `proposal_snippets` DISABLE KEYS */;
/*!40000 ALTER TABLE `proposal_snippets` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `proposal_templates`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `proposal_templates` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned DEFAULT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`private_notes` text COLLATE utf8_unicode_ci NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`html` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`css` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`public_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `proposal_templates_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `proposal_templates_user_id_foreign` (`user_id`),
KEY `proposal_templates_public_id_index` (`public_id`),
CONSTRAINT `proposal_templates_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `proposal_templates_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
2018-03-26 09:39:28 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2018-02-12 09:43:31 +01:00
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `proposal_templates`
--
LOCK TABLES `proposal_templates` WRITE;
/*!40000 ALTER TABLE `proposal_templates` DISABLE KEYS */;
2018-04-11 23:21:32 +02:00
INSERT INTO `proposal_templates` VALUES (1,NULL,NULL,'2018-04-11 18:20:30','2018-04-11 18:20:30',NULL,0,'','Clean','<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n\n <tr class=\"grey-bg\">\n <td><img src=\"$logoUrl\" width=\"193\"/></td>\n <td align=\"right\"><p class=\"quote quote-number grey-upper\">Proposal #$quoteNumber</p></td>\n </tr>\n\n <tr class=\"top-header grey-bg\">\n <td colspan=\"2\" align=\"center\">\n <h1 class=\"heading\">New Business Proposal</h1>\n <p class=\"quote quoteDate grey-upper\">Valid Until $validUntil</p>\n </td>\n </tr>\n\n <tr align=\"center\" class=\"grey-bg proposal-info\">\n <td>\n <p class=\"blue-upper\">Prepared for:</p>\n <h3 class=\"client name\">$client.name</h3>\n <p>\n <span class=\"client address1\">$client.address1</span><br/>\n <span class=\"client city\">$client.city</span>, <span class=\"client state\">$client.state</span> <span class=\"client postal-code\">$client.postal_code</span></p>\n </td>\n <td>\n <p class=\"blue-upper\">Prepared by:</p>\n <h3 class=\"account name\">$account.name</h3>\n <p>\n <span class=\"account address1\">$account.address1</span><br/>\n <span class=\"account city\">$account.city</span>, <span class=\"account state\">$account.state</span> <span class=\"account postal-code\">$account.postal_code</span></p>\n </td>\n </tr>\n </td>\n </tr>\n\n <tr>\n <td colspan=\"2\" class=\"card-content\">\n <h2 class=\"card-title\">Project Description:</h2>\n <p class=\"card-text\">Koala Photography seeks a full review of their historical financial records and future accounting needs. At the start, our experts carefully review your past records and assess your financial services needs according to the nature of your company and suggest the services model best suited to your requirements. The work plan is finalized only after an initial (and possibly subsequent) extensive consultation with [Client.Company]. Periodic review of our services and client feedback is an essential feature of our work plan which ensures that we remain an efficient accounting partner for your business.</p><br/>\n </td>\n </tr>\n <tr>\n <td colspan=\"2\">\n <hr/>\n </td>\n </tr>\n <tr>\n <td class=\"grid-item-card card-content\">\n <h2 class=\"card-title\">Objective:</h2>\n <p class=\"card-text\">Koala Photography seeks a full review of their historical financial records and future accounting needs. At the start, our experts carefully review your past records and assess your financial services needs according to the nature of your company and suggest the services model best suited to your requirements. The work plan is finalized only after an initial (and possibly subsequent) extensive consultation with [Client.Company]. Periodic review of our services and client feedback is an essential feature of our work plan which ensures that we remain an efficient accounting partner for your business.</p>\n </td>\n <td class=\"grid-item-card card-content\">\n <h2 class=\"card-title\">Goal:</h2>\n <p class=\"card-text\">Koala Photography seeks a full review of their historical financial records and future accounting needs. At the start, our experts carefully review your past records and assess your financial services needs according to the nature of your company and suggest the services model best suited to your requirements. The work plan is finalized only after an initial (and possibly subsequent) extensive consultation with [Client.Company]. Periodic review of our services and client feedback is an essential feature of our work plan which ensures that we remain an efficient accounting partner for your business.</p>\n </td>\n </tr>\n\n <tr class=\"block-quote\" align=\"center\">\n <td colspan=\"2\">\n <img src=\"$quoteImageUrl\" width=\"25\"/>\n <p class=\"quote\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce congue auctor magna id sodales. Maecenas mollis justo sed tempor facilisis. Ut malesuada in nibh ultrices auctor. Proin id maximus ipsum. Sed eu magna ac nisl sollicitudin porta in non augue. Maur
2018-02-12 09:43:31 +01:00
/*!40000 ALTER TABLE `proposal_templates` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `proposals`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `proposals` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`invoice_id` int(10) unsigned NOT NULL,
`proposal_template_id` int(10) unsigned DEFAULT NULL,
`private_notes` text COLLATE utf8_unicode_ci NOT NULL,
`html` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`css` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`public_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `proposals_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `proposals_user_id_foreign` (`user_id`),
KEY `proposals_invoice_id_index` (`invoice_id`),
KEY `proposals_proposal_template_id_index` (`proposal_template_id`),
KEY `proposals_public_id_index` (`public_id`),
CONSTRAINT `proposals_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `proposals_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE,
CONSTRAINT `proposals_proposal_template_id_foreign` FOREIGN KEY (`proposal_template_id`) REFERENCES `proposal_templates` (`id`) ON DELETE CASCADE,
CONSTRAINT `proposals_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `proposals`
--
LOCK TABLES `proposals` WRITE;
/*!40000 ALTER TABLE `proposals` DISABLE KEYS */;
/*!40000 ALTER TABLE `proposals` ENABLE KEYS */;
UNLOCK TABLES;
2017-06-26 16:23:30 +02:00
--
-- Table structure for table `recurring_expenses`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `recurring_expenses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`account_id` int(10) unsigned NOT NULL,
`vendor_id` int(10) unsigned DEFAULT NULL,
`user_id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned DEFAULT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`amount` decimal(13,2) NOT NULL,
`private_notes` text COLLATE utf8_unicode_ci NOT NULL,
`public_notes` text COLLATE utf8_unicode_ci NOT NULL,
`invoice_currency_id` int(10) unsigned DEFAULT NULL,
`expense_currency_id` int(10) unsigned DEFAULT NULL,
`should_be_invoiced` tinyint(1) NOT NULL DEFAULT '1',
`expense_category_id` int(10) unsigned DEFAULT NULL,
`tax_name1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate1` decimal(13,3) NOT NULL,
`tax_name2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate2` decimal(13,3) NOT NULL,
`frequency_id` int(10) unsigned NOT NULL,
`start_date` date DEFAULT NULL,
`end_date` date DEFAULT NULL,
`last_sent_date` timestamp NULL DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `recurring_expenses_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `recurring_expenses_user_id_foreign` (`user_id`),
KEY `recurring_expenses_account_id_index` (`account_id`),
KEY `recurring_expenses_invoice_currency_id_index` (`invoice_currency_id`),
KEY `recurring_expenses_expense_currency_id_index` (`expense_currency_id`),
KEY `recurring_expenses_expense_category_id_index` (`expense_category_id`),
KEY `recurring_expenses_public_id_index` (`public_id`),
CONSTRAINT `recurring_expenses_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `recurring_expenses_expense_category_id_foreign` FOREIGN KEY (`expense_category_id`) REFERENCES `expense_categories` (`id`) ON DELETE CASCADE,
CONSTRAINT `recurring_expenses_expense_currency_id_foreign` FOREIGN KEY (`expense_currency_id`) REFERENCES `currencies` (`id`),
CONSTRAINT `recurring_expenses_invoice_currency_id_foreign` FOREIGN KEY (`invoice_currency_id`) REFERENCES `currencies` (`id`),
CONSTRAINT `recurring_expenses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `recurring_expenses`
--
LOCK TABLES `recurring_expenses` WRITE;
/*!40000 ALTER TABLE `recurring_expenses` DISABLE KEYS */;
/*!40000 ALTER TABLE `recurring_expenses` ENABLE KEYS */;
UNLOCK TABLES;
2017-12-11 20:33:50 +01:00
--
-- Table structure for table `scheduled_reports`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `scheduled_reports` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`config` text COLLATE utf8_unicode_ci NOT NULL,
`frequency` enum('daily','weekly','biweekly','monthly') COLLATE utf8_unicode_ci NOT NULL,
`send_date` date NOT NULL,
`public_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `scheduled_reports_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `scheduled_reports_user_id_foreign` (`user_id`),
KEY `scheduled_reports_account_id_index` (`account_id`),
CONSTRAINT `scheduled_reports_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `scheduled_reports_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `scheduled_reports`
--
LOCK TABLES `scheduled_reports` WRITE;
/*!40000 ALTER TABLE `scheduled_reports` DISABLE KEYS */;
/*!40000 ALTER TABLE `scheduled_reports` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `security_codes`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `security_codes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
`contact_id` int(10) unsigned DEFAULT NULL,
`attempts` smallint(6) NOT NULL,
`code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`bot_user_id` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `security_codes_bot_user_id_unique` (`bot_user_id`),
KEY `security_codes_account_id_index` (`account_id`),
KEY `security_codes_user_id_foreign` (`user_id`),
KEY `security_codes_contact_id_foreign` (`contact_id`),
CONSTRAINT `security_codes_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `security_codes_contact_id_foreign` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`id`) ON DELETE CASCADE,
CONSTRAINT `security_codes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `security_codes`
--
LOCK TABLES `security_codes` WRITE;
/*!40000 ALTER TABLE `security_codes` DISABLE KEYS */;
/*!40000 ALTER TABLE `security_codes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sizes`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sizes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sizes`
--
LOCK TABLES `sizes` WRITE;
/*!40000 ALTER TABLE `sizes` DISABLE KEYS */;
INSERT INTO `sizes` VALUES (1,'1 - 3'),(2,'4 - 10'),(3,'11 - 50'),(4,'51 - 100'),(5,'101 - 500'),(6,'500+');
/*!40000 ALTER TABLE `sizes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `subscriptions`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `subscriptions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`event_id` int(10) unsigned DEFAULT NULL,
`target_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
2017-12-11 20:33:50 +01:00
`public_id` int(10) unsigned DEFAULT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
2018-01-23 11:53:42 +01:00
`format` enum('JSON','UBL') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'JSON',
PRIMARY KEY (`id`),
2017-12-11 20:33:50 +01:00
UNIQUE KEY `subscriptions_account_id_public_id_unique` (`account_id`,`public_id`),
CONSTRAINT `subscriptions_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `subscriptions`
--
LOCK TABLES `subscriptions` WRITE;
/*!40000 ALTER TABLE `subscriptions` DISABLE KEYS */;
/*!40000 ALTER TABLE `subscriptions` ENABLE KEYS */;
UNLOCK TABLES;
2018-01-01 22:17:36 +01:00
--
-- Table structure for table `task_statuses`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `task_statuses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`sort_order` smallint(6) NOT NULL DEFAULT '0',
`public_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `task_statuses_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `task_statuses_user_id_foreign` (`user_id`),
KEY `task_statuses_account_id_index` (`account_id`),
KEY `task_statuses_public_id_index` (`public_id`),
CONSTRAINT `task_statuses_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `task_statuses_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `task_statuses`
--
LOCK TABLES `task_statuses` WRITE;
/*!40000 ALTER TABLE `task_statuses` DISABLE KEYS */;
/*!40000 ALTER TABLE `task_statuses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tasks`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tasks` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`client_id` int(10) unsigned DEFAULT NULL,
`invoice_id` int(10) unsigned DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
`public_id` int(10) unsigned NOT NULL,
`is_running` tinyint(1) NOT NULL DEFAULT '0',
`time_log` text COLLATE utf8_unicode_ci,
`project_id` int(10) unsigned DEFAULT NULL,
2018-01-01 22:17:36 +01:00
`task_status_id` int(10) unsigned DEFAULT NULL,
`task_status_sort_order` smallint(6) NOT NULL DEFAULT '0',
2018-04-11 23:21:32 +02:00
`custom_value1` text COLLATE utf8_unicode_ci,
`custom_value2` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
UNIQUE KEY `tasks_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `tasks_user_id_foreign` (`user_id`),
KEY `tasks_invoice_id_foreign` (`invoice_id`),
KEY `tasks_client_id_foreign` (`client_id`),
KEY `tasks_account_id_index` (`account_id`),
KEY `tasks_public_id_index` (`public_id`),
KEY `tasks_project_id_index` (`project_id`),
2018-01-01 22:17:36 +01:00
KEY `tasks_task_status_id_index` (`task_status_id`),
CONSTRAINT `tasks_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `tasks_client_id_foreign` FOREIGN KEY (`client_id`) REFERENCES `clients` (`id`) ON DELETE CASCADE,
CONSTRAINT `tasks_invoice_id_foreign` FOREIGN KEY (`invoice_id`) REFERENCES `invoices` (`id`) ON DELETE CASCADE,
CONSTRAINT `tasks_project_id_foreign` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE,
2018-01-01 22:17:36 +01:00
CONSTRAINT `tasks_task_status_id_foreign` FOREIGN KEY (`task_status_id`) REFERENCES `task_statuses` (`id`) ON DELETE CASCADE,
CONSTRAINT `tasks_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tasks`
--
LOCK TABLES `tasks` WRITE;
/*!40000 ALTER TABLE `tasks` DISABLE KEYS */;
/*!40000 ALTER TABLE `tasks` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tax_rates`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tax_rates` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`rate` decimal(13,3) NOT NULL,
`public_id` int(10) unsigned NOT NULL,
`is_inclusive` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `tax_rates_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `tax_rates_user_id_foreign` (`user_id`),
KEY `tax_rates_account_id_index` (`account_id`),
CONSTRAINT `tax_rates_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `tax_rates_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tax_rates`
--
LOCK TABLES `tax_rates` WRITE;
/*!40000 ALTER TABLE `tax_rates` DISABLE KEYS */;
/*!40000 ALTER TABLE `tax_rates` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `themes`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `themes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `themes`
--
LOCK TABLES `themes` WRITE;
/*!40000 ALTER TABLE `themes` DISABLE KEYS */;
INSERT INTO `themes` VALUES (1,'amelia'),(2,'cerulean'),(3,'cosmo'),(4,'cyborg'),(5,'flatly'),(6,'journal'),(7,'readable'),(8,'simplex'),(9,'slate'),(10,'spacelab'),(11,'united'),(12,'yeti');
/*!40000 ALTER TABLE `themes` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `timezones`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `timezones` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`location` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `timezones`
--
LOCK TABLES `timezones` WRITE;
/*!40000 ALTER TABLE `timezones` DISABLE KEYS */;
INSERT INTO `timezones` VALUES (1,'Pacific/Midway','(GMT-11:00) Midway Island'),(2,'US/Samoa','(GMT-11:00) Samoa'),(3,'US/Hawaii','(GMT-10:00) Hawaii'),(4,'US/Alaska','(GMT-09:00) Alaska'),(5,'US/Pacific','(GMT-08:00) Pacific Time (US &amp; Canada)'),(6,'America/Tijuana','(GMT-08:00) Tijuana'),(7,'US/Arizona','(GMT-07:00) Arizona'),(8,'US/Mountain','(GMT-07:00) Mountain Time (US &amp; Canada)'),(9,'America/Chihuahua','(GMT-07:00) Chihuahua'),(10,'America/Mazatlan','(GMT-07:00) Mazatlan'),(11,'America/Mexico_City','(GMT-06:00) Mexico City'),(12,'America/Monterrey','(GMT-06:00) Monterrey'),(13,'Canada/Saskatchewan','(GMT-06:00) Saskatchewan'),(14,'US/Central','(GMT-06:00) Central Time (US &amp; Canada)'),(15,'US/Eastern','(GMT-05:00) Eastern Time (US &amp; Canada)'),(16,'US/East-Indiana','(GMT-05:00) Indiana (East)'),(17,'America/Bogota','(GMT-05:00) Bogota'),(18,'America/Lima','(GMT-05:00) Lima'),(19,'America/Caracas','(GMT-04:30) Caracas'),(20,'Canada/Atlantic','(GMT-04:00) Atlantic Time (Canada)'),(21,'America/La_Paz','(GMT-04:00) La Paz'),(22,'America/Santiago','(GMT-04:00) Santiago'),(23,'Canada/Newfoundland','(GMT-03:30) Newfoundland'),(24,'America/Buenos_Aires','(GMT-03:00) Buenos Aires'),(25,'America/Godthab','(GMT-03:00) Greenland'),(26,'Atlantic/Stanley','(GMT-02:00) Stanley'),(27,'Atlantic/Azores','(GMT-01:00) Azores'),(28,'Atlantic/Cape_Verde','(GMT-01:00) Cape Verde Is.'),(29,'Africa/Casablanca','(GMT) Casablanca'),(30,'Europe/Dublin','(GMT) Dublin'),(31,'Europe/Lisbon','(GMT) Lisbon'),(32,'Europe/London','(GMT) London'),(33,'Africa/Monrovia','(GMT) Monrovia'),(34,'Europe/Amsterdam','(GMT+01:00) Amsterdam'),(35,'Europe/Belgrade','(GMT+01:00) Belgrade'),(36,'Europe/Berlin','(GMT+01:00) Berlin'),(37,'Europe/Bratislava','(GMT+01:00) Bratislava'),(38,'Europe/Brussels','(GMT+01:00) Brussels'),(39,'Europe/Budapest','(GMT+01:00) Budapest'),(40,'Europe/Copenhagen','(GMT+01:00) Copenhagen'),(41,'Europe/Ljubljana','(GMT+01:00) Ljubljana'),(42,'Europe/Madrid','(GMT+01:00) Madrid'),(43,'Europe/Paris','(GMT+01:00) Paris'),(44,'Europe/Prague','(GMT+01:00) Prague'),(45,'Europe/Rome','(GMT+01:00) Rome'),(46,'Europe/Sarajevo','(GMT+01:00) Sarajevo'),(47,'Europe/Skopje','(GMT+01:00) Skopje'),(48,'Europe/Stockholm','(GMT+01:00) Stockholm'),(49,'Europe/Vienna','(GMT+01:00) Vienna'),(50,'Europe/Warsaw','(GMT+01:00) Warsaw'),(51,'Europe/Zagreb','(GMT+01:00) Zagreb'),(52,'Europe/Athens','(GMT+02:00) Athens'),(53,'Europe/Bucharest','(GMT+02:00) Bucharest'),(54,'Africa/Cairo','(GMT+02:00) Cairo'),(55,'Africa/Harare','(GMT+02:00) Harare'),(56,'Europe/Helsinki','(GMT+02:00) Helsinki'),(57,'Europe/Istanbul','(GMT+02:00) Istanbul'),(58,'Asia/Jerusalem','(GMT+02:00) Jerusalem'),(59,'Europe/Kiev','(GMT+02:00) Kyiv'),(60,'Europe/Minsk','(GMT+02:00) Minsk'),(61,'Europe/Riga','(GMT+02:00) Riga'),(62,'Europe/Sofia','(GMT+02:00) Sofia'),(63,'Europe/Tallinn','(GMT+02:00) Tallinn'),(64,'Europe/Vilnius','(GMT+02:00) Vilnius'),(65,'Asia/Baghdad','(GMT+03:00) Baghdad'),(66,'Asia/Kuwait','(GMT+03:00) Kuwait'),(67,'Africa/Nairobi','(GMT+03:00) Nairobi'),(68,'Asia/Riyadh','(GMT+03:00) Riyadh'),(69,'Asia/Tehran','(GMT+03:30) Tehran'),(70,'Europe/Moscow','(GMT+04:00) Moscow'),(71,'Asia/Baku','(GMT+04:00) Baku'),(72,'Europe/Volgograd','(GMT+04:00) Volgograd'),(73,'Asia/Muscat','(GMT+04:00) Muscat'),(74,'Asia/Tbilisi','(GMT+04:00) Tbilisi'),(75,'Asia/Yerevan','(GMT+04:00) Yerevan'),(76,'Asia/Kabul','(GMT+04:30) Kabul'),(77,'Asia/Karachi','(GMT+05:00) Karachi'),(78,'Asia/Tashkent','(GMT+05:00) Tashkent'),(79,'Asia/Kolkata','(GMT+05:30) Kolkata'),(80,'Asia/Kathmandu','(GMT+05:45) Kathmandu'),(81,'Asia/Yekaterinburg','(GMT+06:00) Ekaterinburg'),(82,'Asia/Almaty','(GMT+06:00) Almaty'),(83,'Asia/Dhaka','(GMT+06:00) Dhaka'),(84,'Asia/Novosibirsk','(GMT+07:00) Novosibirsk'),(85,'Asia/Bangkok','(GMT+07:00) Bangkok'),(86,'Asia/Ho_Chi_Minh','(GMT+07.00) Ho Chi Minh'),(87,'Asia/Jakarta','(GMT+07:00) Jakarta'),(88,'Asia/Krasnoyarsk','(GMT+08:00) Krasnoyarsk'),(89,'Asia/Chongqing','(GMT+08:00) Chongqing'),(90,'Asia/Hong_Kong','(GMT+08:00) Hong Kong'),(91,'Asia/Kuala_Lu
/*!40000 ALTER TABLE `timezones` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user_accounts`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_accounts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id1` int(10) unsigned DEFAULT NULL,
`user_id2` int(10) unsigned DEFAULT NULL,
`user_id3` int(10) unsigned DEFAULT NULL,
`user_id4` int(10) unsigned DEFAULT NULL,
`user_id5` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
2018-03-26 09:39:28 +02:00
KEY `user_accounts_user_id1_index` (`user_id1`),
KEY `user_accounts_user_id2_index` (`user_id2`),
KEY `user_accounts_user_id3_index` (`user_id3`),
KEY `user_accounts_user_id4_index` (`user_id4`),
KEY `user_accounts_user_id5_index` (`user_id5`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `user_accounts`
--
LOCK TABLES `user_accounts` WRITE;
/*!40000 ALTER TABLE `user_accounts` DISABLE KEYS */;
/*!40000 ALTER TABLE `user_accounts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`first_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`phone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`confirmation_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`registered` tinyint(1) NOT NULL DEFAULT '0',
`confirmed` tinyint(1) NOT NULL DEFAULT '0',
`notify_sent` tinyint(1) NOT NULL DEFAULT '1',
`notify_viewed` tinyint(1) NOT NULL DEFAULT '0',
`notify_paid` tinyint(1) NOT NULL DEFAULT '1',
`public_id` int(10) unsigned DEFAULT NULL,
`force_pdfjs` tinyint(1) NOT NULL DEFAULT '0',
`remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`news_feed_id` int(10) unsigned DEFAULT NULL,
`notify_approved` tinyint(1) NOT NULL DEFAULT '1',
`failed_logins` smallint(6) DEFAULT NULL,
2017-06-20 20:34:07 +02:00
`dark_mode` tinyint(1) DEFAULT '1',
`referral_code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`oauth_user_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`oauth_provider_id` int(10) unsigned DEFAULT NULL,
`is_admin` tinyint(1) NOT NULL DEFAULT '1',
`permissions` int(10) unsigned NOT NULL DEFAULT '0',
`bot_user_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`google_2fa_secret` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
2018-01-01 22:17:36 +01:00
`remember_2fa_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
2018-03-26 09:39:28 +02:00
`slack_webhook_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`accepted_terms_version` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`accepted_terms_timestamp` timestamp NULL DEFAULT NULL,
`accepted_terms_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `users_username_unique` (`username`),
UNIQUE KEY `users_account_id_public_id_unique` (`account_id`,`public_id`),
2017-12-11 20:33:50 +01:00
UNIQUE KEY `users_oauth_user_id_oauth_provider_id_unique` (`oauth_user_id`,`oauth_provider_id`),
KEY `users_account_id_index` (`account_id`),
CONSTRAINT `users_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `vendor_contacts`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vendor_contacts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`vendor_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`is_primary` tinyint(1) NOT NULL DEFAULT '0',
`first_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`phone` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`public_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `vendor_contacts_account_id_public_id_unique` (`account_id`,`public_id`),
KEY `vendor_contacts_user_id_foreign` (`user_id`),
KEY `vendor_contacts_vendor_id_index` (`vendor_id`),
CONSTRAINT `vendor_contacts_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `vendor_contacts_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
CONSTRAINT `vendor_contacts_vendor_id_foreign` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `vendor_contacts`
--
LOCK TABLES `vendor_contacts` WRITE;
/*!40000 ALTER TABLE `vendor_contacts` DISABLE KEYS */;
/*!40000 ALTER TABLE `vendor_contacts` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `vendors`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vendors` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`user_id` int(10) unsigned NOT NULL,
`account_id` int(10) unsigned NOT NULL,
`currency_id` int(10) unsigned DEFAULT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`address1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`address2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`city` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`state` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`postal_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`country_id` int(10) unsigned DEFAULT NULL,
`work_phone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`private_notes` text COLLATE utf8_unicode_ci NOT NULL,
`website` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`is_deleted` tinyint(4) NOT NULL DEFAULT '0',
`public_id` int(11) NOT NULL DEFAULT '0',
`vat_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`id_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`transaction_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
2018-04-11 23:21:32 +02:00
`custom_value1` text COLLATE utf8_unicode_ci,
`custom_value2` text COLLATE utf8_unicode_ci,
PRIMARY KEY (`id`),
KEY `vendors_account_id_foreign` (`account_id`),
KEY `vendors_user_id_foreign` (`user_id`),
KEY `vendors_country_id_foreign` (`country_id`),
KEY `vendors_currency_id_foreign` (`currency_id`),
CONSTRAINT `vendors_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`id`) ON DELETE CASCADE,
CONSTRAINT `vendors_country_id_foreign` FOREIGN KEY (`country_id`) REFERENCES `countries` (`id`),
CONSTRAINT `vendors_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `currencies` (`id`),
CONSTRAINT `vendors_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `vendors`
--
LOCK TABLES `vendors` WRITE;
/*!40000 ALTER TABLE `vendors` DISABLE KEYS */;
/*!40000 ALTER TABLE `vendors` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
2018-04-11 23:21:32 +02:00
-- Dump completed on 2018-04-12 0:20:31