Skip to content

Commit

Permalink
Update Database Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
DanDude0 committed Jul 11, 2024
1 parent c0c3277 commit d0f8b28
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions SQL Scripts/access_control_schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
SQLyog Community
MySQL - 10.5.15-MariaDB-0+deb11u1-log : Database - access_control
MySQL - 10.11.6-MariaDB-0+deb12u1-log : Database - access_control
*********************************************************************
*/

Expand All @@ -17,24 +17,24 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/`access_control` /*!40100 DEFAULT CHARAC

CREATE TABLE `attempt` (
`attempt_id` int(11) NOT NULL AUTO_INCREMENT,
`keycode` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`keycode` varchar(255) NOT NULL DEFAULT '',
`member_id` int(11) NOT NULL,
`reader_id` int(11) NOT NULL,
`access_granted` tinyint(1) NOT NULL DEFAULT 0,
`login` tinyint(1) NOT NULL DEFAULT 0,
`logout` tinyint(1) NOT NULL DEFAULT 0,
`action` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`attempt_time` datetime NOT NULL,
`action` varchar(255) NOT NULL DEFAULT '',
`attempt_time` datetime /* mariadb-5.3 */ NOT NULL,
PRIMARY KEY (`attempt_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1438479 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
) ENGINE=MyISAM AUTO_INCREMENT=1981581 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*Table structure for table `audit` */

CREATE TABLE `audit` (
`audit_id` int(11) NOT NULL AUTO_INCREMENT,
`member_id` int(11) NOT NULL,
`created` datetime NOT NULL DEFAULT current_timestamp(),
`action` varchar(8192) COLLATE utf8mb4_unicode_ci NOT NULL,
`action` varchar(8192) NOT NULL,
PRIMARY KEY (`audit_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Expand All @@ -46,19 +46,19 @@ CREATE TABLE `charge` (
`reader_id` int(11) NOT NULL,
`charge_time` datetime NOT NULL,
`amount` decimal(8,2) NOT NULL,
`description` varchar(4096) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(4096) NOT NULL,
`invoice_id` bigint(20) DEFAULT NULL,
`document_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`document_number` varchar(255) DEFAULT NULL,
`invoice_line_id` bigint(20) DEFAULT NULL,
`updated_time` datetime NOT NULL,
PRIMARY KEY (`charge_id`)
) ENGINE=MyISAM AUTO_INCREMENT=287 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
) ENGINE=MyISAM AUTO_INCREMENT=434 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*Table structure for table `group` */

CREATE TABLE `group` (
`group_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`group_id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Expand All @@ -74,22 +74,22 @@ CREATE TABLE `group_member` (
/*Table structure for table `keycode` */

CREATE TABLE `keycode` (
`keycode_id` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
`keycode_id` varchar(32) NOT NULL,
`member_id` int(11) NOT NULL,
`updated` datetime NOT NULL,
`updated` datetime /* mariadb-5.3 */ NOT NULL,
PRIMARY KEY (`keycode_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

/*Table structure for table `member` */

CREATE TABLE `member` (
`member_id` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`apricot_admin` tinyint(1) NOT NULL,
`joined` datetime NOT NULL,
`expires` datetime NOT NULL,
`updated` datetime NOT NULL,
`joined` datetime /* mariadb-5.3 */ NOT NULL,
`expires` datetime /* mariadb-5.3 */ NOT NULL,
`updated` datetime /* mariadb-5.3 */ NOT NULL,
PRIMARY KEY (`member_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Expand All @@ -99,23 +99,24 @@ CREATE TABLE `network_event` (
`network_event_id` int(11) NOT NULL AUTO_INCREMENT,
`reader_id` int(11) NOT NULL,
`online` tinyint(1) NOT NULL,
`event_time` datetime NOT NULL,
`event_time` datetime /* mariadb-5.3 */ NOT NULL,
PRIMARY KEY (`network_event_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

/*Table structure for table `reader` */

CREATE TABLE `reader` (
`reader_id` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`timeout` int(11) NOT NULL DEFAULT 10,
`name` varchar(255) NOT NULL,
`timeout` decimal(11,3) NOT NULL DEFAULT 10.000,
`invert_screen` tinyint(1) NOT NULL DEFAULT 0,
`enabled` tinyint(1) NOT NULL DEFAULT 1,
`group_id` int(11) NOT NULL DEFAULT 0,
`address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`version` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`address` varchar(255) NOT NULL DEFAULT '',
`version` varchar(255) NOT NULL DEFAULT '',
`initialized` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`settings` varchar(8192) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`status` varchar(4096) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`settings` varchar(8192) NOT NULL DEFAULT '',
`status` varchar(4096) NOT NULL DEFAULT '',
PRIMARY KEY (`reader_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Expand Down

0 comments on commit d0f8b28

Please sign in to comment.