1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00
invoiceninja/database/setup.sql

2596 lines
370 KiB
MySQL
Raw Normal View History

2017-08-07 13:12:47 +02:00
-- MySQL dump 10.13 Distrib 5.7.19, for Linux (x86_64)
--
-- Host: localhost Database: ninja
-- ------------------------------------------------------
2017-08-07 13:12:47 +02:00
-- Server version 5.7.19-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`
--
DROP TABLE IF EXISTS `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,
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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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',
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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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_label1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_value1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_label2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_value2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_client_label1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_client_label2` 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_label1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_invoice_label2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`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',
`custom_invoice_text_label1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_invoice_text_label2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`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',
`custom_invoice_item_label1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_invoice_item_label2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`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-04-26 08:19:05 +02:00
`custom_contact_label1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_contact_label2` varchar(255) COLLATE utf8_unicode_ci 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,
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`
--
DROP TABLE IF EXISTS `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,
`task_id` int(11) 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`),
CONSTRAINT `activities_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 `activities`
--
LOCK TABLES `activities` WRITE;
/*!40000 ALTER TABLE `activities` DISABLE KEYS */;
/*!40000 ALTER TABLE `activities` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `affiliates`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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,
`custom_value1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_value2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`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',
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`),
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`),
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`
--
DROP TABLE IF EXISTS `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`),
KEY `companies_payment_id_foreign` (`payment_id`),
CONSTRAINT `companies_payment_id_foreign` FOREIGN KEY (`payment_id`) REFERENCES `payments` (`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`
--
DROP TABLE IF EXISTS `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,
2017-04-26 08:19:05 +02:00
`custom_value1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_value2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
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`
--
DROP TABLE IF EXISTS `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 */;
2017-06-15 09:53:18 +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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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',
PRIMARY KEY (`id`)
2017-07-17 19:15:08 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=68 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 */;
2017-07-17 19:15:08 +02:00
INSERT INTO `currencies` VALUES (1,'US Dollar','$','2',',','.','USD',0),(2,'British Pound','£','2',',','.','GBP',0),(3,'Euro','','2','.',',','EUR',0),(4,'South African Rand','R','2','.',',','ZAR',0),(5,'Danish Krone','kr','2','.',',','DKK',1),(6,'Israeli Shekel','NIS ','2',',','.','ILS',0),(7,'Swedish Krona','kr','2','.',',','SEK',1),(8,'Kenyan Shilling','KSh ','2',',','.','KES',0),(9,'Canadian Dollar','C$','2',',','.','CAD',0),(10,'Philippine Peso','P ','2',',','.','PHP',0),(11,'Indian Rupee','Rs. ','2',',','.','INR',0),(12,'Australian Dollar','$','2',',','.','AUD',0),(13,'Singapore Dollar','','2',',','.','SGD',0),(14,'Norske Kroner','kr','2','.',',','NOK',1),(15,'New Zealand Dollar','$','2',',','.','NZD',0),(16,'Vietnamese Dong','','0','.',',','VND',0),(17,'Swiss Franc','','2','\'','.','CHF',0),(18,'Guatemalan Quetzal','Q','2',',','.','GTQ',0),(19,'Malaysian Ringgit','RM','2',',','.','MYR',0),(20,'Brazilian Real','R$','2','.',',','BRL',0),(21,'Thai Baht','','2',',','.','THB',0),(22,'Nigerian Naira','','2',',','.','NGN',0),(23,'Argentine Peso','$','2','.',',','ARS',0),(24,'Bangladeshi Taka','Tk','2',',','.','BDT',0),(25,'United Arab Emirates Dirham','DH ','2',',','.','AED',0),(26,'Hong Kong Dollar','','2',',','.','HKD',0),(27,'Indonesian Rupiah','Rp','2',',','.','IDR',0),(28,'Mexican Peso','$','2',',','.','MXN',0),(29,'Egyptian Pound','E£','2',',','.','EGP',0),(30,'Colombian Peso','$','2','.',',','COP',0),(31,'West African Franc','CFA ','2',',','.','XOF',0),(32,'Chinese Renminbi','RMB ','2',',','.','CNY',0),(33,'Rwandan Franc','RF ','2',',','.','RWF',0),(34,'Tanzanian Shilling','TSh ','2',',','.','TZS',0),(35,'Netherlands Antillean Guilder','','2','.',',','ANG',0),(36,'Trinidad and Tobago Dollar','TT$','2',',','.','TTD',0),(37,'East Caribbean Dollar','EC$','2',',','.','XCD',0),(38,'Ghanaian Cedi','','2',',','.','GHS',0),(39,'Bulgarian Lev','','2',' ','.','BGN',0),(40,'Aruban Florin','Afl. ','2',' ','.','AWG',0),(41,'Turkish Lira','TL ','2','.',',','TRY',0),(42,'Romanian New Leu','','2',',','.','RON',0),(43,'Croatian Kuna','kn','2','.',',','HRK',0),(44,'Saudi Riyal','','2',',','.','SAR',0),(45,'Japanese Yen','¥','0',',','.','JPY',0),(46,'Maldivian Rufiyaa','','2',',','.','MVR',0),(47,'Costa Rican Colón','','2',',','.','CRC',0),(48,'Pakistani Rupee','Rs ','0',',','.','PKR',0),(49,'Polish Zloty','','2',' ',',','PLN',1),(50,'Sri Lankan Rupee','LKR','2',',','.','LKR',1),(51,'Czech Koruna','','2',' ',',','CZK',1),(52,'Uruguayan Peso','$','2','.',',','UYU',0),(53,'Namibian Dollar','$','2',',','.','NAD',0),(54,'Tunisian Dinar','','2',',','.','TND',0),(55,'Russian Ruble','','2',',','.','RUB',0),(56,'Mozambican Metical','MT','2','.',',','MZN',1),(57,'Omani Rial','','2',',','.','OMR',0),(58,'Ukrainian Hryvnia','','2',',','.','UAH',0),(59,'Macanese Pataca','MOP$','2',',','.','MOP',0),(60,'Taiwan New Dollar','NT$','2',',','.','TWD',0),(61,'Dominican Peso','RD$','2',',','.','DOP',0),(62,'Chilean Peso','$','0','.',',','CLP',0),(63,'Icelandic Króna','kr','2','.',',','ISK',1),(64,'Papua New Guinean Kina','K','2',',','.','PGK',0),(65,'Jordanian Dinar','','2',',','.','JOD',0),(66,'Myanmar Kyat','K','2',',','.','MMK',0),(67,'Peruvian Sol','S/ ','2',',','.','PEN',0);
/*!40000 ALTER TABLE `currencies` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `date_formats`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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',
PRIMARY KEY (`id`),
UNIQUE KEY `documents_account_id_public_id_unique` (`account_id`,`public_id`),
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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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,
`exchange_rate` decimal(13,4) NOT NULL,
`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,
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`),
CONSTRAINT `expenses_account_id_foreign` FOREIGN KEY (`account_id`) REFERENCES `accounts` (`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`
--
DROP TABLE IF EXISTS `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,
`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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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,
PRIMARY KEY (`id`)
2017-02-27 17:02:14 +01: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 `frequencies`
--
LOCK TABLES `frequencies` WRITE;
/*!40000 ALTER TABLE `frequencies` DISABLE KEYS */;
2017-02-27 17:02:14 +01:00
INSERT INTO `frequencies` VALUES (1,'Weekly'),(2,'Two weeks'),(3,'Four weeks'),(4,'Monthly'),(5,'Two months'),(6,'Three months'),(7,'Six months'),(8,'Annually');
/*!40000 ALTER TABLE `frequencies` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gateway_types`
--
DROP TABLE IF EXISTS `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`)
) ENGINE=InnoDB AUTO_INCREMENT=7 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 */;
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');
/*!40000 ALTER TABLE `gateway_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gateways`
--
DROP TABLE IF EXISTS `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
2017-06-29 14:09:16 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=64 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 */;
2017-08-18 11:56:55 +02:00
INSERT INTO `gateways` VALUES (1,'2017-08-17 06:29:17','2017-08-17 06:29:17','Authorize.Net AIM','AuthorizeNet_AIM',1,1,4,0,NULL,0,0),(2,'2017-08-17 06:29:17','2017-08-17 06:29:17','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2017-08-17 06:29:17','2017-08-17 06:29:17','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2017-08-17 06:29:17','2017-08-17 06:29:17','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2017-08-17 06:29:17','2017-08-17 06:29:17','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2017-08-17 06:29:17','2017-08-17 06:29:17','GoCardless','GoCardless',1,1,10000,0,NULL,1,0),(7,'2017-08-17 06:29:17','2017-08-17 06:29:17','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2017-08-17 06:29:17','2017-08-17 06:29:17','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2017-08-17 06:29:17','2017-08-17 06:29:17','Mollie','Mollie',1,1,7,0,NULL,1,0),(10,'2017-08-17 06:29:17','2017-08-17 06:29:17','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2017-08-17 06:29:17','2017-08-17 06:29:17','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2017-08-17 06:29:18','2017-08-17 06:29:18','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2017-08-17 06:29:18','2017-08-17 06:29:18','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2017-08-17 06:29:18','2017-08-17 06:29:18','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2017-08-17 06:29:18','2017-08-17 06:29:18','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2017-08-17 06:29:18','2017-08-17 06:29:18','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2017-08-17 06:29:18','2017-08-17 06:29:18','PayPal Express','PayPal_Express',1,1,3,0,NULL,1,0),(18,'2017-08-17 06:29:18','2017-08-17 06:29:18','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2017-08-17 06:29:18','2017-08-17 06:29:18','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2017-08-17 06:29:18','2017-08-17 06:29:18','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2017-08-17 06:29:18','2017-08-17 06:29:18','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2017-08-17 06:29:18','2017-08-17 06:29:18','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2017-08-17 06:29:18','2017-08-17 06:29:18','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2017-08-17 06:29:18','2017-08-17 06:29:18','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2017-08-17 06:29:18','2017-08-17 06:29:18','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2017-08-17 06:29:18','2017-08-17 06:29:18','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2017-08-17 06:29:18','2017-08-17 06:29:18','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2017-08-17 06:29:18','2017-08-17 06:29:18','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2017-08-17 06:29:18','2017-08-17 06:29:18','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2017-08-17 06:29:18','2017-08-17 06:29:18','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2017-08-17 06:29:18','2017-08-17 06:29:18','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2017-08-17 06:29:18','2017-08-17 06:29:18','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2017-08-17 06:29:18','2017-08-17 06:29:18','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2017-08-17 06:29:18','2017-08-17 06:29:18','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2017-08-17 06:29:18','2017-08-17 06:29:18','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2017-08-17 06:29:18','2017-08-17 06:29:18','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2017-08-17 06:29:18','2017-08-17 06:29:18','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2017-08-17 06:29:18','2017-08-17 06:29:18','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2017-08-17 06:29:18','2017-08-17 06:29:18','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2017-08-17 06:29:18','2017-08-17 06:29:18','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2017-08-17 06:29:18','2017-08-17 06:29:18','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2017-08-17 06:29:18','2017-
/*!40000 ALTER TABLE `gateways` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `industries`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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 */;
2017-08-16 14:41:47 +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);','{\n \"content\": [{\n \"columns\": [\n {\n \"image\": \"$accountLogo\",\n \"fit\": [120, 80]\n },\n {\n \"stack\": \"$accountDetails\",\n \"margin\": [7, 0, 0, 0]\n },\n {\n \"stack\": \"$accountAddress\"\n }\n ]\n },\n {\n \"text\": \"$entityTypeUC\",\n \"margin\": [8, 30, 8, 5],\n \"style\": \"entityTypeLabel\"\n \n },\n {\n \"table\": {\n \"headerRows\": 1,\n \"widths\": [\"auto\", \"auto\", \"*\"],\n \"body\": [\n [\n {
/*!40000 ALTER TABLE `invoice_designs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `invoice_items`
--
DROP TABLE IF EXISTS `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,
`qty` decimal(15,4) DEFAULT NULL,
`tax_name1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`tax_rate1` decimal(13,3) DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
`custom_value1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_value2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`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',
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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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,
`discount` double(8,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',
`custom_text_value1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_text_value2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`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,
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`
--
DROP TABLE IF EXISTS `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` 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`),
KEY `jobs_queue_reserved_reserved_at_index` (`queue`,`reserved`,`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`
--
DROP TABLE IF EXISTS `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-06-15 09:53:18 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=26 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 */;
2017-06-15 09:53:18 +02: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_UK'),(21,'Portuguese - Portugal','pt_PT'),(22,'Slovenian','sl'),(23,'Finnish','fi'),(24,'Romanian','ro'),(25,'Turkish - Turkey','tr_TR');
/*!40000 ALTER TABLE `languages` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `licenses`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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,
PRIMARY KEY (`id`),
2017-05-08 13:19:48 +02:00
UNIQUE KEY `lookup_accounts_account_key_unique` (`account_key`),
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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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;
--
-- Table structure for table `lookup_users`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB 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 */;
2017-08-16 14:41:47 +02:00
INSERT INTO `migrations` VALUES ('2013_11_05_180133_confide_setup_users_table',1),('2013_11_28_195703_setup_countries_table',1),('2014_02_13_151500_add_cascase_drops',1),('2014_02_19_151817_add_support_for_invoice_designs',1),('2014_03_03_155556_add_phone_to_account',1),('2014_03_19_201454_add_language_support',1),('2014_03_20_200300_create_payment_libraries',1),('2014_03_23_051736_enable_forcing_jspdf',1),('2014_03_25_102200_add_sort_and_recommended_to_gateways',1),('2014_04_03_191105_add_pro_plan',1),('2014_04_17_100523_add_remember_token',1),('2014_04_17_145108_add_custom_fields',1),('2014_04_23_170909_add_products_settings',1),('2014_04_29_174315_add_advanced_settings',1),('2014_05_17_175626_add_quotes',1),('2014_06_17_131940_add_accepted_credit_cards_to_account_gateways',1),('2014_07_13_142654_one_click_install',1),('2014_07_17_205900_support_hiding_quantity',1),('2014_07_24_171214_add_zapier_support',1),('2014_10_01_141248_add_company_vat_number',1),('2014_10_05_141856_track_last_seen_message',1),('2014_10_06_103529_add_timesheets',1),('2014_10_06_195330_add_invoice_design_table',1),('2014_10_13_054100_add_invoice_number_settings',1),('2014_10_14_225227_add_danish_translation',1),('2014_10_22_174452_add_affiliate_price',1),('2014_10_30_184126_add_company_id_number',1),('2014_11_04_200406_allow_null_client_currency',1),('2014_12_03_154119_add_discount_type',1),('2015_02_12_102940_add_email_templates',1),('2015_02_17_131714_support_token_billing',1),('2015_02_27_081836_add_invoice_footer',1),('2015_03_03_140259_add_tokens',1),('2015_03_09_151011_add_ip_to_activity',1),('2015_03_15_174122_add_pdf_email_attachment_option',1),('2015_03_30_100000_create_password_resets_table',1),('2015_04_12_093447_add_sv_language',1),('2015_04_13_100333_add_notify_approved',1),('2015_04_16_122647_add_partial_amount_to_invoices',1),('2015_05_21_184104_add_font_size',1),('2015_05_27_121828_add_tasks',1),('2015_05_27_170808_add_custom_invoice_labels',1),('2015_06_09_134208_add_has_tasks_to_invoices',1),('2015_06_14_093410_enable_resuming_tasks',1),('2015_06_14_173025_multi_company_support',1),('2015_07_07_160257_support_locking_account',1),('2015_07_08_114333_simplify_tasks',1),('2015_07_19_081332_add_custom_design',1),('2015_07_27_183830_add_pdfmake_support',1),('2015_08_13_084041_add_formats_to_datetime_formats_table',1),('2015_09_04_080604_add_swap_postal_code',1),('2015_09_07_135935_add_account_domain',1),('2015_09_10_185135_add_reminder_emails',1),('2015_10_07_135651_add_social_login',1),('2015_10_21_075058_add_default_tax_rates',1),('2015_10_21_185724_add_invoice_number_pattern',1),('2015_10_27_180214_add_is_system_to_activities',1),('2015_10_29_133747_add_default_quote_terms',1),('2015_11_01_080417_encrypt_tokens',1),('2015_11_03_181318_improve_currency_localization',1),('2015_11_30_133206_add_email_designs',1),('2015_12_27_154513_add_reminder_settings',1),('2015_12_30_042035_add_client_view_css',1),('2016_01_04_175228_create_vendors_table',1),('2016_01_06_153144_add_invoice_font_support',1),('2016_01_17_155725_add_quote_to_invoice_option',1),('2016_01_18_195351_add_bank_accounts',1),('2016_01_24_112646_add_bank_subaccounts',1),('2016_01_27_173015_add_header_footer_option',1),('2016_02_01_135956_add_source_currency_to_expenses',1),('2016_02_25_152948_add_client_password',1),('2016_02_28_081424_add_custom_invoice_fields',1),('2016_03_14_066181_add_user_permissions',1),('2016_03_14_214710_add_support_three_decimal_taxes',1),('2016_03_22_168362_add_documents',1),('2016_03_23_215049_support_multiple_tax_rates',1),('2016_04_16_103943_enterprise_plan',1),('2016_04_18_174135_add_page_size',1),('2016_04_23_182223_payments_changes',1),('2016_05_16_102925_add_swap_currency_symbol_to_currency',1),('2016_05_18_085739_add_invoice_type_support',1),('2016_05_24_164847_wepay_ach',1),('2016_07_08_083802_support_new_pricing',1),('2016_07_13_083821_add_buy_now_buttons',1),('2016_08_10_184027_add_support_for_bots',1),('2016_09_05_150625_create_gateway_types',1),('2016_10_20_191150_add_expense_to_activities',1),('2016_11_03_113316_add_invoice_signature
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `password_resets`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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 */;
2017-08-18 11:56:55 +02:00
INSERT INTO `payment_libraries` VALUES (1,'2017-08-17 06:29:16','2017-08-17 06:29:16','Omnipay',1),(2,'2017-08-17 06:29:16','2017-08-17 06:29:16','PHP-Payments [Deprecated]',1);
/*!40000 ALTER TABLE `payment_libraries` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_methods`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`)
) 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 */;
2017-08-18 11:56:55 +02:00
INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2017-08-17 06:29:16','2017-08-17 06:29:16',NULL,0,0,1),(2,10,'Net 10','2017-08-17 06:29:16','2017-08-17 06:29:16',NULL,0,0,2),(3,14,'Net 14','2017-08-17 06:29:16','2017-08-17 06:29:16',NULL,0,0,3),(4,15,'Net 15','2017-08-17 06:29:16','2017-08-17 06:29:16',NULL,0,0,4),(5,30,'Net 30','2017-08-17 06:29:16','2017-08-17 06:29:16',NULL,0,0,5),(6,60,'Net 60','2017-08-17 06:29:16','2017-08-17 06:29:16',NULL,0,0,6),(7,90,'Net 90','2017-08-17 06:29:16','2017-08-17 06:29:16',NULL,0,0,7),(8,-1,'Net 0','2017-08-17 06:29:19','2017-08-17 06:29:19',NULL,0,0,0);
/*!40000 ALTER TABLE `payment_terms` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payment_types`
--
DROP TABLE IF EXISTS `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
2017-05-18 11:35:48 +02:00
) ENGINE=InnoDB AUTO_INCREMENT=28 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 */;
2017-05-18 11:35:48 +02:00
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);
/*!40000 ALTER TABLE `payment_types` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `payments`
--
DROP TABLE IF EXISTS `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,
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`
--
DROP TABLE IF EXISTS `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,
`qty` decimal(15,4) DEFAULT NULL,
`public_id` int(10) unsigned NOT NULL,
`is_deleted` tinyint(1) NOT NULL DEFAULT '0',
2017-02-27 17:02:14 +01:00
`custom_value1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`custom_value2` varchar(255) COLLATE utf8_unicode_ci 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,
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`
--
DROP TABLE IF EXISTS `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,
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;
2017-06-26 16:23:30 +02:00
--
-- Table structure for table `recurring_expenses`
--
DROP TABLE IF EXISTS `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;
--
-- Table structure for table `security_codes`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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,
PRIMARY KEY (`id`),
KEY `subscriptions_account_id_foreign` (`account_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;
--
-- Table structure for table `tasks`
--
DROP TABLE IF EXISTS `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,
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`),
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,
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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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 & Canada)'),(6,'America/Tijuana','(GMT-08:00) Tijuana'),(7,'US/Arizona','(GMT-07:00) Arizona'),(8,'US/Mountain','(GMT-07:00) Mountain Time (US & 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 & Canada)'),(15,'US/Eastern','(GMT-05:00) Eastern Time (US & 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`
--
DROP TABLE IF EXISTS `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`),
KEY `user_accounts_user_id1_foreign` (`user_id1`),
KEY `user_accounts_user_id2_foreign` (`user_id2`),
KEY `user_accounts_user_id3_foreign` (`user_id3`),
KEY `user_accounts_user_id4_foreign` (`user_id4`),
KEY `user_accounts_user_id5_foreign` (`user_id5`),
CONSTRAINT `user_accounts_user_id1_foreign` FOREIGN KEY (`user_id1`) REFERENCES `users` (`id`),
CONSTRAINT `user_accounts_user_id2_foreign` FOREIGN KEY (`user_id2`) REFERENCES `users` (`id`),
CONSTRAINT `user_accounts_user_id3_foreign` FOREIGN KEY (`user_id3`) REFERENCES `users` (`id`),
CONSTRAINT `user_accounts_user_id4_foreign` FOREIGN KEY (`user_id4`) REFERENCES `users` (`id`),
CONSTRAINT `user_accounts_user_id5_foreign` FOREIGN KEY (`user_id5`) REFERENCES `users` (`id`)
) 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`
--
DROP TABLE IF EXISTS `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,
PRIMARY KEY (`id`),
UNIQUE KEY `users_username_unique` (`username`),
UNIQUE KEY `users_account_id_public_id_unique` (`account_id`,`public_id`),
2017-06-01 18:13:13 +02: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`
--
DROP TABLE IF EXISTS `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`
--
DROP TABLE IF EXISTS `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,
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 */;
2017-08-18 11:56:55 +02:00
-- Dump completed on 2017-08-17 12:29:20