You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
215 lines
6.8 KiB
215 lines
6.8 KiB
-- phpMyAdmin SQL Dump
|
|
-- version 5.2.1
|
|
-- https://www.phpmyadmin.net/
|
|
--
|
|
-- Host: 172.20.0.2
|
|
-- Generation Time: Jul 20, 2023 at 03:01 PM
|
|
-- Server version: 10.4.28-MariaDB-1:10.4.28+maria~ubu2004
|
|
-- PHP Version: 8.1.15
|
|
|
|
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 */;
|
|
|
|
--
|
|
-- Database: `minibase_projects`
|
|
--
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `market`
|
|
--
|
|
|
|
CREATE TABLE `market` (
|
|
`id` int(11) NOT NULL COMMENT 'primary key for thsi market',
|
|
`name` varchar(50) NOT NULL COMMENT 'Name of the market',
|
|
`upload_date` date NOT NULL DEFAULT current_timestamp(),
|
|
`last_update_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp()
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
--
|
|
-- Dumping data for table `market`
|
|
--
|
|
|
|
INSERT INTO `market` (`id`, `name`, `upload_date`, `last_update_date`) VALUES
|
|
(1, 'Industrial', '2022-11-14', '2022-11-14 16:29:05'),
|
|
(2, 'Medical', '2022-11-14', '2022-11-14 16:29:05');
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `project`
|
|
--
|
|
|
|
CREATE TABLE `project` (
|
|
`id` int(11) NOT NULL,
|
|
`name` varchar(150) NOT NULL,
|
|
`description` varchar(500) NOT NULL,
|
|
`upload_date` date NOT NULL DEFAULT current_timestamp(),
|
|
`last_update_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
|
|
`project_owner_id` int(11) NOT NULL,
|
|
`project_buyer_id` int(11) DEFAULT NULL,
|
|
`date_prototype` date NOT NULL,
|
|
`qte_prototype` int(11) NOT NULL,
|
|
`date_production` date NOT NULL,
|
|
`qte_production` int(11) NOT NULL,
|
|
`qte_start` int(11) NOT NULL,
|
|
`client_id` int(11) NOT NULL,
|
|
`market_id` int(11) NOT NULL,
|
|
`segment_id` int(11) NOT NULL,
|
|
`internal_owner_id` int(11) NOT NULL,
|
|
`inernal_sales_id` int(11) NOT NULL,
|
|
`hierarchic_level` int(11) DEFAULT NULL,
|
|
`part_of` int(11) DEFAULT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
--
|
|
-- Dumping data for table `project`
|
|
--
|
|
|
|
INSERT INTO `project` (`id`, `name`, `description`, `upload_date`, `last_update_date`, `project_owner_id`, `project_buyer_id`, `date_prototype`, `qte_prototype`, `date_production`, `qte_production`, `qte_start`, `client_id`, `market_id`, `segment_id`, `internal_owner_id`, `inernal_sales_id`, `hierarchic_level`, `part_of`) VALUES
|
|
(1, 'STWA-HS', 'Spraying unit', '2022-11-14', '2022-11-14 16:56:44', 1, NULL, '2023-03-14', 2, '2023-11-14', 200000, 200000, 1, 1, 2, 2, 3, NULL, NULL);
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `project_element`
|
|
--
|
|
|
|
CREATE TABLE `project_element` (
|
|
`id` int(11) NOT NULL,
|
|
`name` varchar(75) NOT NULL,
|
|
`description` varchar(300) NOT NULL,
|
|
`upload_date` date NOT NULL DEFAULT current_timestamp(),
|
|
`last_update_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp(),
|
|
`comment` varchar(300) DEFAULT NULL,
|
|
`qte_per_project` int(11) NOT NULL,
|
|
`parent_project` int(11) NOT NULL
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
--
|
|
-- Dumping data for table `project_element`
|
|
--
|
|
|
|
INSERT INTO `project_element` (`id`, `name`, `description`, `upload_date`, `last_update_date`, `comment`, `qte_per_project`, `parent_project`) VALUES
|
|
(1, 'Power Board', 'Power board for battery operation', '2022-11-14', '2022-11-14 17:19:16', NULL, 1, 1);
|
|
|
|
-- --------------------------------------------------------
|
|
|
|
--
|
|
-- Table structure for table `segment`
|
|
--
|
|
|
|
CREATE TABLE `segment` (
|
|
`id` int(11) NOT NULL,
|
|
`name` varchar(50) NOT NULL,
|
|
`upload_date` date NOT NULL DEFAULT current_timestamp(),
|
|
`last_update_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE current_timestamp()
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
|
|
--
|
|
-- Dumping data for table `segment`
|
|
--
|
|
|
|
INSERT INTO `segment` (`id`, `name`, `upload_date`, `last_update_date`) VALUES
|
|
(1, 'Mesurement', '2022-11-14', '2022-11-14 16:29:57'),
|
|
(2, 'Automation', '2022-11-14', '2022-11-14 16:29:57');
|
|
|
|
--
|
|
-- Indexes for dumped tables
|
|
--
|
|
|
|
--
|
|
-- Indexes for table `market`
|
|
--
|
|
ALTER TABLE `market`
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
--
|
|
-- Indexes for table `project`
|
|
--
|
|
ALTER TABLE `project`
|
|
ADD PRIMARY KEY (`id`),
|
|
ADD KEY `fk_market` (`market_id`),
|
|
ADD KEY `fk_segment` (`segment_id`),
|
|
ADD KEY `fk_project_owner` (`project_owner_id`),
|
|
ADD KEY `fk_project_buyer` (`project_buyer_id`) USING BTREE,
|
|
ADD KEY `fk_client` (`client_id`),
|
|
ADD KEY `fk_int_responsible` (`internal_owner_id`),
|
|
ADD KEY `fk_ext_responsible` (`inernal_sales_id`);
|
|
|
|
--
|
|
-- Indexes for table `project_element`
|
|
--
|
|
ALTER TABLE `project_element`
|
|
ADD PRIMARY KEY (`id`),
|
|
ADD KEY `fk_parent_project` (`parent_project`);
|
|
|
|
--
|
|
-- Indexes for table `segment`
|
|
--
|
|
ALTER TABLE `segment`
|
|
ADD PRIMARY KEY (`id`);
|
|
|
|
--
|
|
-- AUTO_INCREMENT for dumped tables
|
|
--
|
|
|
|
--
|
|
-- AUTO_INCREMENT for table `market`
|
|
--
|
|
ALTER TABLE `market`
|
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key for thsi market', AUTO_INCREMENT=3;
|
|
|
|
--
|
|
-- AUTO_INCREMENT for table `project`
|
|
--
|
|
ALTER TABLE `project`
|
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
|
|
|
|
--
|
|
-- AUTO_INCREMENT for table `project_element`
|
|
--
|
|
ALTER TABLE `project_element`
|
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
|
|
|
|
--
|
|
-- AUTO_INCREMENT for table `segment`
|
|
--
|
|
ALTER TABLE `segment`
|
|
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
|
|
|
|
--
|
|
-- Constraints for dumped tables
|
|
--
|
|
|
|
--
|
|
-- Constraints for table `project`
|
|
--
|
|
ALTER TABLE `project`
|
|
ADD CONSTRAINT `fk_client` FOREIGN KEY (`client_id`) REFERENCES `minibase_relationships`.`person` (`company`),
|
|
ADD CONSTRAINT `fk_ext_responsible` FOREIGN KEY (`inernal_sales_id`) REFERENCES `minibase_relationships`.`person` (`id`),
|
|
ADD CONSTRAINT `fk_int_responsible` FOREIGN KEY (`internal_owner_id`) REFERENCES `minibase_relationships`.`person` (`id`),
|
|
ADD CONSTRAINT `fk_market` FOREIGN KEY (`market_id`) REFERENCES `market` (`id`),
|
|
ADD CONSTRAINT `fk_project_buyer` FOREIGN KEY (`project_buyer_id`) REFERENCES `minibase_relationships`.`person` (`id`),
|
|
ADD CONSTRAINT `fk_project_owner` FOREIGN KEY (`project_owner_id`) REFERENCES `minibase_relationships`.`person` (`id`),
|
|
ADD CONSTRAINT `fk_segment` FOREIGN KEY (`segment_id`) REFERENCES `segment` (`id`);
|
|
|
|
--
|
|
-- Constraints for table `project_element`
|
|
--
|
|
ALTER TABLE `project_element`
|
|
ADD CONSTRAINT `fk_parent_project` FOREIGN KEY (`parent_project`) REFERENCES `project` (`id`);
|
|
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 */;
|