Skip to content

Commit

Permalink
Updated SQL Table info
Browse files Browse the repository at this point in the history
Duplicate Keys have been removed. Group and Permission (and other) fields
have been changed to varchar.  Definition column added to aauth_groups table.
Boolean fields changed to tinyint(1).
  • Loading branch information
tswagger committed May 6, 2015
1 parent 6eddbc6 commit a4726f2
Showing 1 changed file with 34 additions and 49 deletions.
83 changes: 34 additions & 49 deletions sql/Aauth_v2.sql
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
/*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50508
Source Host : localhost:3306
Source Database : aauth_v2_dev
Target Server Type : MYSQL
Target Server Version : 50508
File Encoding : 65001
Date: 2014-07-03 21:23:21
Aauth SQL Table Structure
*/

SET FOREIGN_KEY_CHECKS=0;
Expand All @@ -20,25 +9,26 @@ SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
DROP TABLE IF EXISTS `aauth_groups`;
CREATE TABLE `aauth_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text,
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100),
`definition` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of aauth_groups
-- ----------------------------
INSERT INTO `aauth_groups` VALUES ('1', 'Admin');
INSERT INTO `aauth_groups` VALUES ('2', 'Public');
INSERT INTO `aauth_groups` VALUES ('3', 'Default');
INSERT INTO `aauth_groups` VALUES ('1', 'Admin', 'Super Admin Group');
INSERT INTO `aauth_groups` VALUES ('2', 'Public', 'Public Access Group');
INSERT INTO `aauth_groups` VALUES ('3', 'Default', 'Default Access Group');

-- ----------------------------
-- Table structure for `aauth_perms`
-- ----------------------------
DROP TABLE IF EXISTS `aauth_perms`;
CREATE TABLE `aauth_perms` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text,
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100),
`definition` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Expand All @@ -52,11 +42,9 @@ CREATE TABLE `aauth_perms` (
-- ----------------------------
DROP TABLE IF EXISTS `aauth_perm_to_group`;
CREATE TABLE `aauth_perm_to_group` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`perm_id` int(11) DEFAULT NULL,
`group_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `perm_id_group_id_index` (`perm_id`,`group_id`)
`perm_id` int(11) unsigned DEFAULT NULL,
`group_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`perm_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
Expand All @@ -68,11 +56,9 @@ CREATE TABLE `aauth_perm_to_group` (
-- ----------------------------
DROP TABLE IF EXISTS `aauth_perm_to_user`;
CREATE TABLE `aauth_perm_to_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`perm_id` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `perm_id_user_id_index` (`perm_id`,`user_id`)
`perm_id` int(11) unsigned DEFAULT NULL,
`user_id` int(11) unsigned DEFAULT NULL,
PRIMARY KEY (`perm_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
Expand All @@ -84,13 +70,13 @@ CREATE TABLE `aauth_perm_to_user` (
-- ----------------------------
DROP TABLE IF EXISTS `aauth_pms`;
CREATE TABLE `aauth_pms` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sender_id` int(11) NOT NULL,
`receiver_id` int(11) NOT NULL,
`title` text NOT NULL,
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`sender_id` int(11) unsigned NOT NULL,
`receiver_id` int(11) unsigned NOT NULL,
`title` varchar(255) NOT NULL,
`message` text,
`date` datetime DEFAULT NULL,
`read` int(11) DEFAULT '0',
`read` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `full_index` (`id`,`sender_id`,`receiver_id`,`read`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Expand All @@ -104,8 +90,8 @@ CREATE TABLE `aauth_pms` (
-- ----------------------------
DROP TABLE IF EXISTS `aauth_system_variables`;
CREATE TABLE `aauth_system_variables` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` text NOT NULL,
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`key` varchar(100) NOT NULL,
`value` text,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Expand All @@ -119,11 +105,11 @@ CREATE TABLE `aauth_system_variables` (
-- ----------------------------
DROP TABLE IF EXISTS `aauth_users`;
CREATE TABLE `aauth_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` text COLLATE utf8_general_ci NOT NULL,
`pass` text COLLATE utf8_general_ci NOT NULL,
`name` text COLLATE utf8_general_ci,
`banned` int(11) DEFAULT '0',
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(100) COLLATE utf8_general_ci NOT NULL,
`pass` varchar(50) COLLATE utf8_general_ci NOT NULL,

This comment has been minimized.

Copy link
@marcoscssno

marcoscssno May 18, 2015

pass should be size of 64. I had a problem where no user in my application could login, even creating a new one, and trying to login right at the time, failed. Then I tried with an old download I've did last year and it worked perfectly. So I looked and found this problem. After I changed to 255 it worked.

This comment has been minimized.

Copy link
@tswagger

tswagger May 18, 2015

Author Contributor

Thank you, I will fix that in my next push.

`name` varchar(100) COLLATE utf8_general_ci,
`banned` tinyint(1) DEFAULT '0',
`last_login` datetime DEFAULT NULL,
`last_activity` datetime DEFAULT NULL,
`last_login_attempt` datetime DEFAULT NULL,
Expand All @@ -139,17 +125,16 @@ CREATE TABLE `aauth_users` (
-- ----------------------------
-- Records of aauth_users
-- ----------------------------
INSERT INTO `aauth_users` VALUES ('1', 'admin@admin.com', 'dd5073c93fb477a167fd69072e95455834acd93df8fed41a2c468c45b394bfe3', 'Admin', '0', null, null, null, null, null, null, null, null, '0');
INSERT INTO `aauth_users` VALUES ('1', 'admin@example.com', 'dd5073c93fb477a167fd69072e95455834acd93df8fed41a2c468c45b394bfe3', 'Admin', '0', null, null, null, null, null, null, null, null, '0');

-- ----------------------------
-- Table structure for `aauth_user_to_group`
-- ----------------------------
DROP TABLE IF EXISTS `aauth_user_to_group`;
CREATE TABLE `aauth_user_to_group` (
`user_id` int(11) NOT NULL DEFAULT '0',
`group_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`,`group_id`),
KEY `user_id_group_id_index` (`user_id`,`group_id`)
`user_id` int(11) unsigned NOT NULL DEFAULT '0',
`group_id` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`user_id`,`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
Expand All @@ -163,9 +148,9 @@ INSERT INTO `aauth_user_to_group` VALUES ('1', '3');
-- ----------------------------
DROP TABLE IF EXISTS `aauth_user_variables`;
CREATE TABLE `aauth_user_variables` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`key` text NOT NULL,
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) unsigned NOT NULL,
`key` varchar(100) NOT NULL,
`value` text,
PRIMARY KEY (`id`),
KEY `user_id_index` (`user_id`)
Expand Down

0 comments on commit a4726f2

Please sign in to comment.