Browse Source

updated Migrations

v3-dev
REJack 7 years ago
parent
commit
9997568460
  1. 40
      application/Database/Migrations/20181026110732_create_users_table.php
  2. 26
      application/Database/Migrations/20181031062503_create_user_variables.php
  3. 16
      application/Database/Migrations/20181031063113_create_login_attempts.php
  4. 12
      application/Database/Migrations/20181031064211_create_groups.php
  5. 10
      application/Database/Migrations/20181031064431_create_group_to_user.php
  6. 10
      application/Database/Migrations/20181031064550_create_group_to_group.php
  7. 12
      application/Database/Migrations/20181031064714_create_perms.php
  8. 10
      application/Database/Migrations/20181031065111_create_perm_to_user.php
  9. 10
      application/Database/Migrations/20181031065240_create_perm_to_group.php

40
application/Database/Migrations/20181026110732_create_users_table.php

@ -12,51 +12,51 @@ class Migration_create_users_table extends Migration
$config = new AauthConfig();
$this->forge->addField([
'id' => array(
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'email' => array(
],
'email' => [
'type' => 'VARCHAR',
'constraint' => 254,
),
'username' => array(
],
'username' => [
'type' => 'VARCHAR',
'constraint' => 150,
'null' => TRUE,
),
'password' => array(
],
'password' => [
'type' => 'VARCHAR',
'constraint' => 60,
),
'banned' => array(
],
'banned' => [
'type' => 'TINYINT',
'constraint' => 1,
'null' => TRUE,
'default' => 0,
),
'created_datetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
'updated_datetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
'last_activity' => array(
],
'created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
'updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
'last_activity' => [
'type' => 'DATETIME',
'default' => NULL,
),
'last_ip_address' => array(
],
'last_ip_address' => [
'type' => 'VARCHAR',
'constraint' => 39,
'default' => '',
),
'last_login' => array(
],
'last_login' => [
'type' => 'DATETIME',
'default' => NULL,
),
'deleted' => array(
],
'deleted' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
),
],
]);
$this->forge->addKey('id', TRUE);
$this->forge->createTable($config->dbTableUsers, TRUE);

26
application/Database/Migrations/20181031062503_create_user_variables.php

@ -10,34 +10,34 @@ class Migration_create_user_variables extends Migration
{
$config = new AauthConfig();
$this->forge->addField([
'id' => array(
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'user_id' => array(
],
'user_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
),
'data_key' => array(
],
'data_key' => [
'type' => 'VARCHAR',
'constraint' => 100,
),
'data_value' => array(
],
'data_value' => [
'type' => 'TEXT',
),
'created_datetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
'updated_datetime' => array(
],
'created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
'updated_at' => [
'type' => 'DATETIME',
'default' => NULL,
),
'system' => array(
],
'system' => [
'type' => 'TINYINT',
'constraint' => 1,
'default' => 0,
),
],
]);
$this->forge->addKey('id', TRUE);
$this->forge->createTable($config->dbTableUserVariables, TRUE);

16
application/Database/Migrations/20181031063113_create_login_attempts.php

@ -10,24 +10,24 @@ class Migration_create_login_attempts extends Migration
{
$config = new AauthConfig();
$this->forge->addField([
'id' => array(
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'ip_address' => array(
],
'ip_address' => [
'type' => 'VARCHAR',
'constraint' => 39,
'default' => 0,
),
'count' => array(
],
'count' => [
'type' => 'TINYINT',
'constraint' => 2,
'default' => 0,
),
'created_datetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
'updated_datetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
],
'created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
'updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP',
]);
$this->forge->addKey('id', TRUE);
$this->forge->createTable($config->dbTableLoginAttempts, TRUE);

12
application/Database/Migrations/20181031064211_create_groups.php

@ -10,19 +10,19 @@ class Migration_create_groups extends Migration
{
$config = new AauthConfig();
$this->forge->addField([
'id' => array(
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'name' => array(
],
'name' => [
'type' => 'VARCHAR',
'constraint' => 100,
),
'definition' => array(
],
'definition' => [
'type' => 'TEXT',
),
],
]);
$this->forge->addKey('id', TRUE);
$this->forge->createTable($config->dbTableGroups, TRUE);

10
application/Database/Migrations/20181031064431_create_group_to_user.php

@ -10,18 +10,18 @@ class Migration_create_group_to_user extends Migration
{
$config = new AauthConfig();
$this->forge->addField([
'group_id' => array(
'group_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
),
'user_id' => array(
],
'user_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
),
],
]);
$this->forge->addKey(array('group_id','user_id'), TRUE);
$this->forge->addKey(['group_id','user_id'], TRUE);
$this->forge->createTable($config->dbTableGroupToUser, TRUE);
}

10
application/Database/Migrations/20181031064550_create_group_to_group.php

@ -10,18 +10,18 @@ class Migration_create_group_to_group extends Migration
{
$config = new AauthConfig();
$this->forge->addField([
'group_id' => array(
'group_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
),
'subgroup_id' => array(
],
'subgroup_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
),
],
]);
$this->forge->addKey(array('group_id','subgroup_id'), TRUE);
$this->forge->addKey(['group_id','subgroup_id'], TRUE);
$this->forge->createTable($config->dbTableGroupToGroup, TRUE);
}

12
application/Database/Migrations/20181031064714_create_perms.php

@ -10,19 +10,19 @@ class Migration_create_perms extends Migration
{
$config = new AauthConfig();
$this->forge->addField([
'id' => array(
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'name' => array(
],
'name' => [
'type' => 'VARCHAR',
'constraint' => 100,
),
'definition' => array(
],
'definition' => [
'type' => 'TEXT',
),
],
]);
$this->forge->addKey('id', TRUE);
$this->forge->createTable($config->dbTablePerms, TRUE);

10
application/Database/Migrations/20181031065111_create_perm_to_user.php

@ -10,18 +10,18 @@ class Migration_create_perm_to_user extends Migration
{
$config = new AauthConfig();
$this->forge->addField([
'perm_id' => array(
'perm_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
),
'user_id' => array(
],
'user_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
),
],
]);
$this->forge->addKey(array('perm_id','user_id'), TRUE);
$this->forge->addKey(['perm_id','user_id'], TRUE);
$this->forge->createTable($config->dbTablePermToUser, TRUE);
}

10
application/Database/Migrations/20181031065240_create_perm_to_group.php

@ -10,18 +10,18 @@ class Migration_create_perm_to_group extends Migration
{
$config = new AauthConfig();
$this->forge->addField([
'perm_id' => array(
'perm_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
),
'group_id' => array(
],
'group_id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
),
],
]);
$this->forge->addKey(array('perm_id','user_id'), TRUE);
$this->forge->addKey(['perm_id','user_id'], TRUE);
$this->forge->createTable($config->dbTablePermToGroup, TRUE);
}

Loading…
Cancel
Save