--
-- Host: localhost    Database: user106
-- ------------------------------------------------------


--
-- Table structure for table `Plants`
--

CREATE TABLE `Plants` (
  `plant_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `plant_name` varchar(150) NOT NULL,
  `price` decimal(10,2) NOT NULL CHECK (`price` >= 0),
  `supplier_id` bigint(20) unsigned DEFAULT NULL,
  `color` varchar(50) DEFAULT NULL,
  `propagation_method` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`plant_id`),
  KEY `supplier_id` (`supplier_id`),
  CONSTRAINT `Plants_ibfk_1` FOREIGN KEY (`supplier_id`) REFERENCES `Suppliers` (`supplier_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `Plants`
--

INSERT INTO `Plants` VALUES (1,'Роза чайная',1760.00,1,'красный','черенкование'),(2,'Фикус Бенджамина',2200.50,2,'зеленый','черенкование'),(3,'Орхидея фаленопсис',3850.00,1,'белый','деление');

--
-- Table structure for table `Suppliers`
--

CREATE TABLE `Suppliers` (
  `supplier_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `supplier_name` varchar(150) NOT NULL,
  `contact_info` text DEFAULT NULL,
  `city` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`supplier_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `Suppliers`
--

INSERT INTO `Suppliers` VALUES (1,'Зеленый мир','новый тел: 111-22-33','Москва'),(2,'Флора-сервис','email: info@flora.ru','Санкт-Петербург');

--
-- Table structure for table `Users`
--

CREATE TABLE `Users` (
  `user_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(100) NOT NULL,
  `password_hash` text NOT NULL,
  `role` varchar(50) NOT NULL DEFAULT 'user',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

--
-- Dumping data for table `Users`
--

INSERT INTO `Users` VALUES (1,'admin',' password','admin'),(2,'manager',' password','manager');


