-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Хост: localhost
-- Время создания: Дек 30 2020 г., 14:33
-- Версия сервера: 10.4.16-MariaDB
-- Версия PHP: 7.4.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!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 utf8mb4 */;

--
-- База данных: `reactcrmyii`
--

-- --------------------------------------------------------

--
-- Структура таблицы `banks`
--

CREATE TABLE `banks` (
  `id` int(11) NOT NULL,
  `name` varchar(191) DEFAULT NULL,
  `mfo` varchar(191) DEFAULT NULL,
  `edrpou` varchar(191) DEFAULT NULL,
  `name_e` varchar(191) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  `address` varchar(191) DEFAULT NULL,
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  `deleted_at` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Дамп данных таблицы `banks`
--

INSERT INTO `banks` (`id`, `name`, `mfo`, `edrpou`, `name_e`, `type`, `address`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'ПриватБанк', 'мфо1122', '1234567812', NULL, NULL, 'г. Полтава, ул. Кагамлыка, 30', NULL, NULL, NULL),
(2, 'Альфабанк', 'мфо88878', '998877889', NULL, NULL, NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Структура таблицы `migration`
--

CREATE TABLE `migration` (
  `version` varchar(180) NOT NULL,
  `apply_time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Дамп данных таблицы `migration`
--

INSERT INTO `migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1607420159);

-- --------------------------------------------------------

--
-- Структура таблицы `organizations`
--

CREATE TABLE `organizations` (
  `id` int(11) UNSIGNED NOT NULL,
  `name` varchar(191) NOT NULL,
  `short_name` varchar(191) DEFAULT NULL,
  `vat` tinyint(1) DEFAULT NULL,
  `edrpou` varchar(191) DEFAULT NULL,
  `address_1` varchar(191) DEFAULT NULL,
  `address_2` varchar(191) DEFAULT NULL,
  `address_3` varchar(191) DEFAULT NULL,
  `comment` text DEFAULT NULL,
  `bank_id` int(11) DEFAULT NULL,
  `person_id` int(11) DEFAULT NULL,
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  `deleted_at` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Дамп данных таблицы `organizations`
--

INSERT INTO `organizations` (`id`, `name`, `short_name`, `vat`, `edrpou`, `address_1`, `address_2`, `address_3`, `comment`, `bank_id`, `person_id`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'ФОП \"Широкие Потребности\"', 'Ширпотреб', 3, '00000001', 'адрес 1', 'адрес 2', 'адрес 3', 'lispsum comment', 1, NULL, NULL, NULL, NULL),
(2, 'ФОП \"Абра Кадабра\"', 'Абракадабра', 1, '0000000010', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(14, 'sadf', 'sadf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(15, 'asdfa', 'dfsaa', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(16, 'asdf', 'dsaf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(17, 'asdf', 'safd', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(18, 'asdfa', 'asdffasd', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(19, 'asdfa', 'fasdf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(20, 'asdfa', 'sadfsa', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(21, 'asdfasd', 'dsffas', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(22, 'asdfa', 'dfsasfd', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(23, 'asdfasdf', 'sadffas', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(24, 'asdfads', 'sadfa', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(25, 'asdfafds', 'asdfas', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(26, 'asdfa', 'dffsa', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(27, 'ывфафы', 'выафва', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(28, 'аыфваыфва', 'ыфвавыфаыфв', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(29, 'sadfsadf', 'dsfsadf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(30, 'sadf', 'dfsad', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(31, 'adsfa', 'sadfsadf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(32, 'ыфваыфваф', 'афыва', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(33, 'ыфвафыва', 'аывфва', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(34, 'asdfas', 'dasfasd', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(35, 'sadfasdf', 'sadfdsa', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(36, 'asdfas', 'sadfasdf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(37, 'sdafas', 'sadfasdf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(38, 'sdafafa', 'sdafasd', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(39, 'asdfasdf', 'sadfads', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(40, 'asdfas', 'asdfas', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(41, 'asdfadfa', 'sdadfasd', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(42, 'asdfsa', 'dsfasf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(43, 'dsafdfa', 'fdsafdas', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(44, 'sdfgsdf', 'fdgsdfg', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(45, 'wert', 'erwtertw', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(46, 'sadfa', 'asdfsad', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(47, 'asdfasdf', 'saf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(48, 'asdfasda', 'asdfsad', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(49, 'asdfa', 'sadfasd', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(50, 'asdfas', 'sdfa', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(51, 'asdfasdfs', 'sdafsda', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(52, 'adsfdfsa', 'fdsa', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(53, 'asdfas', 'dfsafas', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(54, 'asdfas', 'fdasdfa', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(55, 'asdfa', 'dsafas', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(56, 'asdfa', 'sdafasdf', 1, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Структура таблицы `persons`
--

CREATE TABLE `persons` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `org_id` int(11) UNSIGNED DEFAULT NULL,
  `first_name` varchar(191) DEFAULT NULL,
  `last_name` varchar(191) DEFAULT NULL,
  `position` varchar(191) DEFAULT NULL,
  `created_at` int(11) DEFAULT NULL,
  `updated_at` int(11) DEFAULT NULL,
  `deleted_at` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Дамп данных таблицы `persons`
--

INSERT INTO `persons` (`id`, `org_id`, `first_name`, `last_name`, `position`, `created_at`, `updated_at`, `deleted_at`) VALUES
(2, 1, 'Василий Пупкин', NULL, NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Структура таблицы `settings`
--

CREATE TABLE `settings` (
  `id` int(11) NOT NULL,
  `invoce` int(11) NOT NULL,
  `act` int(11) NOT NULL,
  `time` int(11) NOT NULL,
  `created_at` int(11) NOT NULL,
  `updated_at` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Дамп данных таблицы `settings`
--

INSERT INTO `settings` (`id`, `invoce`, `act`, `time`, `created_at`, `updated_at`) VALUES
(3, 17, 2, 16, 1607605415, 1607605612);

--
-- Индексы сохранённых таблиц
--

--
-- Индексы таблицы `banks`
--
ALTER TABLE `banks`
  ADD PRIMARY KEY (`id`);

--
-- Индексы таблицы `migration`
--
ALTER TABLE `migration`
  ADD PRIMARY KEY (`version`);

--
-- Индексы таблицы `organizations`
--
ALTER TABLE `organizations`
  ADD PRIMARY KEY (`id`);

--
-- Индексы таблицы `persons`
--
ALTER TABLE `persons`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_prn_id` (`org_id`);

--
-- Индексы таблицы `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT для сохранённых таблиц
--

--
-- AUTO_INCREMENT для таблицы `banks`
--
ALTER TABLE `banks`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT для таблицы `organizations`
--
ALTER TABLE `organizations`
  MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=57;

--
-- AUTO_INCREMENT для таблицы `persons`
--
ALTER TABLE `persons`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT для таблицы `settings`
--
ALTER TABLE `settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- Ограничения внешнего ключа сохраненных таблиц
--

--
-- Ограничения внешнего ключа таблицы `persons`
--
ALTER TABLE `persons`
  ADD CONSTRAINT `fk_prn_id` FOREIGN KEY (`org_id`) REFERENCES `organizations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;

/*!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 */;
