Created
December 13, 2010 14:03
-
-
Save boriscy/739009 to your computer and use it in GitHub Desktop.
demo sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 3.3.8 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost | |
-- Generation Time: Dec 13, 2010 at 10:02 AM | |
-- Server version: 5.1.41 | |
-- PHP Version: 5.3.2-1ubuntu4.5 | |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; | |
-- | |
-- Database: `seema_development` | |
-- | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `admins` | |
-- | |
CREATE TABLE IF NOT EXISTS `admins` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', | |
`encrypted_password` varchar(128) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', | |
`password_salt` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', | |
`reset_password_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`remember_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`remember_created_at` datetime DEFAULT NULL, | |
`sign_in_count` int(11) DEFAULT '0', | |
`current_sign_in_at` datetime DEFAULT NULL, | |
`last_sign_in_at` datetime DEFAULT NULL, | |
`current_sign_in_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`last_sign_in_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`confirmation_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`confirmed_at` datetime DEFAULT NULL, | |
`confirmation_sent_at` datetime DEFAULT NULL, | |
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`phone` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`mobile` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`fax` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`first_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`last_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`active` tinyint(1) DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
`phone_ip` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`birth_date` date DEFAULT NULL, | |
`position` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_admins_on_email` (`email`), | |
UNIQUE KEY `index_admins_on_reset_password_token` (`reset_password_token`), | |
KEY `index_admins_on_active` (`active`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `admins_projects` | |
-- | |
CREATE TABLE IF NOT EXISTS `admins_projects` ( | |
`admin_id` int(11) DEFAULT NULL, | |
`project_id` int(11) DEFAULT NULL, | |
KEY `index_admins_projects_on_admin_id` (`admin_id`), | |
KEY `index_admins_projects_on_project_id` (`project_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `attachments` | |
-- | |
CREATE TABLE IF NOT EXISTS `attachments` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`attachable_id` int(11) DEFAULT NULL, | |
`attachable_type` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`attachment_file_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`attachment_file_size` int(11) DEFAULT NULL, | |
`image` tinyint(1) DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
`position` int(11) DEFAULT NULL, | |
`privacy` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`real_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_attachments_on_attachable_id` (`attachable_id`), | |
KEY `index_attachments_on_attachable_type` (`attachable_type`), | |
KEY `index_attachments_on_image` (`image`), | |
KEY `index_attachments_on_privacy` (`privacy`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=64 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `branches` | |
-- | |
CREATE TABLE IF NOT EXISTS `branches` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=10 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `branches_categories` | |
-- | |
CREATE TABLE IF NOT EXISTS `branches_categories` ( | |
`branch_id` int(11) DEFAULT NULL, | |
`category_id` int(11) DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `categories` | |
-- | |
CREATE TABLE IF NOT EXISTS `categories` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`description` varchar(255) CHARACTER SET utf8 DEFAULT NULL, | |
`parent_id` int(11) DEFAULT NULL, | |
`lft` int(11) DEFAULT NULL, | |
`rgt` int(11) DEFAULT NULL, | |
`depth` int(11) DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_categories_on_parent_id` (`parent_id`), | |
KEY `index_categories_on_name` (`name`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=62 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `categories_companies` | |
-- | |
CREATE TABLE IF NOT EXISTS `categories_companies` ( | |
`category_id` int(11) DEFAULT NULL, | |
`company_id` int(11) DEFAULT NULL, | |
UNIQUE KEY `index_categories_companies_on_category_id_and_company_id` (`category_id`,`company_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `categories_inquiries` | |
-- | |
CREATE TABLE IF NOT EXISTS `categories_inquiries` ( | |
`category_id` int(11) DEFAULT NULL, | |
`inquiry_id` int(11) DEFAULT NULL, | |
KEY `index_categories_inquiries_on_category_id` (`category_id`), | |
KEY `index_categories_inquiries_on_inquiry_id` (`inquiry_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `categories_machines` | |
-- | |
CREATE TABLE IF NOT EXISTS `categories_machines` ( | |
`category_id` int(11) DEFAULT NULL, | |
`machine_id` int(11) DEFAULT NULL, | |
KEY `index_categories_machines_on_category_id` (`category_id`), | |
KEY `index_categories_machines_on_machine_id` (`machine_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `companies` | |
-- | |
CREATE TABLE IF NOT EXISTS `companies` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`branch_id` int(11) DEFAULT NULL, | |
`matchcode` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`notice` varchar(300) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`name1` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`name2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`email` varchar(255) CHARACTER SET utf8 DEFAULT NULL, | |
`postal_street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`postal_postal` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`postal_city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`postal_country_id` int(11) DEFAULT NULL, | |
`delivery_street` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`delivery_postal` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`delivery_city` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`delivery_country_id` int(11) DEFAULT NULL, | |
`phone` varchar(30) CHARACTER SET utf8 DEFAULT NULL, | |
`fax` varchar(30) CHARACTER SET utf8 DEFAULT NULL, | |
`banking_details` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`datev_export` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`kto` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`datev_konto` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`blz` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`datev_erloskonto` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`iban` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`eu_ust_indent_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`bic_swif` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`erloscode_id` int(11) DEFAULT NULL, | |
`mobile` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`contacts_count` int(11) DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_companies_on_branch_id` (`branch_id`), | |
KEY `index_companies_on_postal_country_id` (`postal_country_id`), | |
KEY `index_companies_on_delivery_country_id` (`delivery_country_id`), | |
KEY `index_companies_on_contacts_count` (`contacts_count`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=104 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `countries` | |
-- | |
CREATE TABLE IF NOT EXISTS `countries` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`code` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=239 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `discarted_companies` | |
-- | |
CREATE TABLE IF NOT EXISTS `discarted_companies` ( | |
`company_id` int(11) DEFAULT NULL, | |
`machine_id` int(11) DEFAULT NULL, | |
KEY `index_discarted_companies_on_company_id` (`company_id`), | |
KEY `index_discarted_companies_on_machine_id` (`machine_id`), | |
KEY `index_discarted_companies_on_company_id_and_machine_id` (`company_id`,`machine_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `documents` | |
-- | |
CREATE TABLE IF NOT EXISTS `documents` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`inquiry_id` int(11) DEFAULT NULL, | |
`ctype` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`status` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`total` decimal(10,0) DEFAULT NULL, | |
`machines_count` int(11) DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`erloscode_id` int(11) DEFAULT NULL, | |
`datev_account` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`eu_ust_indent_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_documents_on_inquiry_id` (`inquiry_id`), | |
KEY `index_documents_on_status` (`status`), | |
KEY `index_documents_on_title` (`title`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `document_inquiry_details` | |
-- | |
CREATE TABLE IF NOT EXISTS `document_inquiry_details` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`contact_id` int(11) DEFAULT NULL, | |
`document_id` int(11) DEFAULT NULL, | |
`inquiry_id` int(11) DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_document_inquiry_details_on_contact_id` (`contact_id`), | |
KEY `index_document_inquiry_details_on_document_id` (`document_id`), | |
KEY `index_document_inquiry_details_on_inquiry_id` (`inquiry_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=14 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `document_machines` | |
-- | |
CREATE TABLE IF NOT EXISTS `document_machines` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`document_id` int(11) DEFAULT NULL, | |
`machine_id` int(11) DEFAULT NULL, | |
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`description` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`price` decimal(10,0) DEFAULT NULL, | |
`position` int(11) DEFAULT NULL, | |
`discarted_attachments` varchar(400) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_document_machines_on_document_id` (`document_id`), | |
KEY `index_document_machines_on_machine_id` (`machine_id`), | |
KEY `index_document_machines_on_title` (`title`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `erloscodes` | |
-- | |
CREATE TABLE IF NOT EXISTS `erloscodes` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `inquiries` | |
-- | |
CREATE TABLE IF NOT EXISTS `inquiries` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`subject` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`hide_till` date DEFAULT NULL, | |
`status` tinyint(1) DEFAULT NULL, | |
`status_close_reason` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`details` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`next_step` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`company_id` int(11) DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
`admin_id` int(11) DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_inquiries_on_subject` (`subject`), | |
KEY `index_inquiries_on_hide_till` (`hide_till`), | |
KEY `index_inquiries_on_status` (`status`), | |
KEY `index_inquiries_on_company_id` (`company_id`), | |
KEY `index_inquiries_on_admin_id` (`admin_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=21 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `machines` | |
-- | |
CREATE TABLE IF NOT EXISTS `machines` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`category_id` int(11) DEFAULT NULL, | |
`owner_id` int(11) DEFAULT NULL, | |
`sold_id` int(11) DEFAULT NULL, | |
`name_ge` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`name_en` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`name_ru` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`details_ge` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`details_en` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`details_ru` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`manufacturer` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`year_of_construction` int(11) DEFAULT NULL, | |
`purchase_price` decimal(14,2) DEFAULT NULL, | |
`sales_price` decimal(14,2) DEFAULT NULL, | |
`internal_notice` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`location` varchar(255) CHARACTER SET utf8 DEFAULT NULL, | |
`show_online` tinyint(1) DEFAULT NULL, | |
`machine_status_id` int(11) DEFAULT NULL, | |
`ctype` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`serial_number` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`weight` decimal(14,2) DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
`public_image` varchar(255) CHARACTER SET utf8 DEFAULT NULL, | |
`history` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_machines_on_category_id` (`category_id`), | |
KEY `index_machines_on_offered_by` (`owner_id`), | |
KEY `index_machines_on_sold_to` (`sold_id`), | |
KEY `index_machines_on_machine_status_id` (`machine_status_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=4 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `machine_statuses` | |
-- | |
CREATE TABLE IF NOT EXISTS `machine_statuses` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `mails` | |
-- | |
CREATE TABLE IF NOT EXISTS `mails` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`mailable_id` int(11) DEFAULT NULL, | |
`mailable_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`subject` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`body` text COLLATE utf8_unicode_ci, | |
`attachment` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_mails_on_mailable_id` (`mailable_id`), | |
KEY `index_mails_on_mailable_type` (`mailable_type`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `messages` | |
-- | |
CREATE TABLE IF NOT EXISTS `messages` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`admin_id` int(11) DEFAULT NULL, | |
`type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`subject` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`body` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
`messageable_id` int(11) DEFAULT NULL, | |
`messageable_type` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_messages_on_admin_id` (`admin_id`), | |
KEY `index_messages_on_type` (`type`), | |
KEY `index_messages_on_messageable_id` (`messageable_id`), | |
KEY `index_messages_on_messageable_type` (`messageable_type`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `projects` | |
-- | |
CREATE TABLE IF NOT EXISTS `projects` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`inquiry_id` int(11) DEFAULT NULL, | |
`parent_id` int(11) DEFAULT NULL, | |
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`completed` tinyint(1) DEFAULT '0', | |
`date_start` date DEFAULT NULL, | |
`date_end` date DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
`rgt` int(11) DEFAULT NULL, | |
`lft` int(11) DEFAULT NULL, | |
`depth` int(11) DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_projects_on_inquiry_id` (`inquiry_id`), | |
KEY `index_projects_on_completed` (`completed`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=2 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `project_companies` | |
-- | |
CREATE TABLE IF NOT EXISTS `project_companies` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`company_id` int(11) DEFAULT NULL, | |
`project_id` int(11) DEFAULT NULL, | |
`contact_id` int(11) DEFAULT NULL, | |
`role` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_project_companies_on_company_id` (`company_id`), | |
KEY `index_project_companies_on_project_id` (`project_id`), | |
KEY `index_project_companies_on_contact_id` (`contact_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=11 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `schema_migrations` | |
-- | |
CREATE TABLE IF NOT EXISTS `schema_migrations` ( | |
`version` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
UNIQUE KEY `unique_schema_migrations` (`version`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `tasks` | |
-- | |
CREATE TABLE IF NOT EXISTS `tasks` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`subject` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`completed` tinyint(1) DEFAULT '0', | |
`due_date` datetime DEFAULT NULL, | |
`taskable_id` int(11) DEFAULT NULL, | |
`taskable_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `index_tasks_on_subject` (`subject`), | |
KEY `index_tasks_on_completed` (`completed`), | |
KEY `index_tasks_on_due_date` (`due_date`), | |
KEY `index_tasks_on_taskable_id` (`taskable_id`), | |
KEY `index_tasks_on_taskable_type` (`taskable_type`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=5 ; | |
-- -------------------------------------------------------- | |
-- | |
-- Table structure for table `users` | |
-- | |
CREATE TABLE IF NOT EXISTS `users` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', | |
`encrypted_password` varchar(128) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', | |
`password_salt` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', | |
`reset_password_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`remember_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`remember_created_at` datetime DEFAULT NULL, | |
`sign_in_count` int(11) DEFAULT '0', | |
`current_sign_in_at` datetime DEFAULT NULL, | |
`last_sign_in_at` datetime DEFAULT NULL, | |
`current_sign_in_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`last_sign_in_ip` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`company_id` int(11) DEFAULT NULL, | |
`country_id` int(11) DEFAULT NULL, | |
`name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`company_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`phone` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`mobile` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`fax` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`phone_ip` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`first_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`last_name` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, | |
`position` varchar(255) CHARACTER SET utf8 DEFAULT NULL, | |
`birth_date` date DEFAULT NULL, | |
`created_at` datetime DEFAULT NULL, | |
`updated_at` datetime DEFAULT NULL, | |
`news` tinyint(1) DEFAULT '0', | |
`docs` tinyint(1) DEFAULT '0', | |
`title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
UNIQUE KEY `index_users_on_email` (`email`), | |
UNIQUE KEY `index_users_on_reset_password_token` (`reset_password_token`), | |
KEY `index_users_on_company_id` (`company_id`), | |
KEY `index_users_on_country_id` (`country_id`), | |
KEY `index_users_on_name` (`name`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=505 ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment