SQL dump - Sartani/ajanvaraus GitHub Wiki

Here's the dump for initiliasing the database.

-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/

-- Host: 127.0.0.1 -- Generation Time: 01.10.2017 klo 21:46 -- Palvelimen versio: 10.1.21-MariaDB -- PHP Version: 7.1.1

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

-- -- Database: ajanvaraus


-- -- Rakenne taululle calendar_dates

CREATE TABLE calendar_dates ( calendar_id int(11) NOT NULL, date date NOT NULL, weekday varchar(3) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


-- -- Rakenne taululle calendar_options

CREATE TABLE calendar_options ( calendar_id int(11) NOT NULL, start_date date NOT NULL, end_date date NOT NULL, start_time time NOT NULL, end_time time NOT NULL, break_start_time time DEFAULT NULL, break_end_time time DEFAULT NULL, reservable_days varchar(27) NOT NULL, calendar_name varchar(64) NOT NULL, reservation_intervals int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


-- -- Rakenne taululle calendar_reservations

CREATE TABLE calendar_reservations ( calendar_id int(11) NOT NULL, reservation_date date NOT NULL, reservation_time time NOT NULL, reserver_name varchar(32) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;


-- -- Rakenne taululle users

CREATE TABLE users ( user_id int(11) NOT NULL, user_name varchar(255) COLLATE utf8_unicode_ci NOT NULL, user_password varchar(255) COLLATE utf8_unicode_ci NOT NULL, user_email varchar(255) COLLATE utf8_unicode_ci NOT NULL, user_level int(11) NOT NULL DEFAULT '1' COMMENT 'Käyttäjille tasot' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='Käyttäjän tiedot';

-- -- Vedos taulusta users

INSERT INTO users (user_id, user_name, user_password, user_email, user_level) VALUES (1, 'Admin', 'sanasalainen', '[email protected]', 1);

-- -- Indexes for dumped tables

-- -- Indexes for table calendar_options

ALTER TABLE calendar_options ADD PRIMARY KEY (calendar_id), ADD UNIQUE KEY calendar_name (calendar_name);

-- -- Indexes for table calendar_reservations

ALTER TABLE calendar_reservations ADD KEY calendar_id (calendar_id);

-- -- Indexes for table users

ALTER TABLE users ADD PRIMARY KEY (user_id);

-- -- AUTO_INCREMENT for dumped tables

-- -- AUTO_INCREMENT for table calendar_options

ALTER TABLE calendar_options MODIFY calendar_id int(11) NOT NULL AUTO_INCREMENT;

-- AUTO_INCREMENT for table users

ALTER TABLE users MODIFY user_id int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;