-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add migration files to create newer tables
- Loading branch information
Showing
4 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
orif/timbreuse/Database/Migrations/2024-02-28-071908_CreateUserGroupTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Timbreuse\Database\Migrations; | ||
|
||
use CodeIgniter\Database\Migration; | ||
|
||
class CreateUserGroupTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
$this->forge->addField([ | ||
'id' => [ | ||
'type' => 'INT', | ||
'unsigned' => true, | ||
'auto_increment' => true | ||
], | ||
'fk_user_group_id' => [ | ||
'type' => 'INT', | ||
'unsigned' => true | ||
], | ||
'name' => [ | ||
'type' => 'VARCHAR', | ||
'constraint' => '45' | ||
] | ||
]); | ||
|
||
$this->forge->addKey('id', true); | ||
$this->forge->addForeignKey('fk_user_group_id', 'user_group', 'id'); | ||
$this->forge->createTable('user_group', true); | ||
} | ||
|
||
public function down() | ||
{ | ||
// | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
orif/timbreuse/Database/Migrations/2024-02-28-072536_CreateUserSyncGroupTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Timbreuse\Database\Migrations; | ||
|
||
use CodeIgniter\Database\Migration; | ||
|
||
class CreateUserSyncGroupTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
$this->forge->addField([ | ||
'id' => [ | ||
'type' => 'INT', | ||
'unsigned' => true, | ||
'auto_increment' => true | ||
], | ||
'fk_user_group_id' => [ | ||
'type' => 'INT', | ||
'unsigned' => true | ||
], | ||
'fk_user_sync_id' => [ | ||
'type' => 'INT' | ||
] | ||
]); | ||
|
||
$this->forge->addKey('id', true); | ||
$this->forge->addForeignKey('fk_user_group_id', 'user_group', 'id'); | ||
$this->forge->addForeignKey('fk_user_sync_id', 'user_sync', 'id_user'); | ||
$this->forge->createTable('user_sync_group', true); | ||
} | ||
|
||
public function down() | ||
{ | ||
// | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
orif/timbreuse/Database/Migrations/2024-02-28-072602_CreateEventTypeTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Timbreuse\Database\Migrations; | ||
|
||
use CodeIgniter\Database\Migration; | ||
|
||
class CreateEventTypeTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
$this->forge->addField([ | ||
'id' => [ | ||
'type' => 'INT', | ||
'unsigned' => true, | ||
'auto_increment' => true | ||
], | ||
'name' => [ | ||
'type' => 'VARCHAR', | ||
'constraint' => '45' | ||
], | ||
'is_group_event' => [ | ||
'type' => 'BOOLEAN' | ||
], | ||
'is_personal_event' => [ | ||
'type' => 'BOOLEAN' | ||
], | ||
]); | ||
|
||
$this->forge->addKey('id', true); | ||
$this->forge->createTable('event_type', true); | ||
} | ||
|
||
public function down() | ||
{ | ||
// | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
orif/timbreuse/Database/Migrations/2024-02-28-072619_CreatePlanningEventTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Timbreuse\Database\Migrations; | ||
|
||
use CodeIgniter\Database\Migration; | ||
|
||
class CreatePlanningEventTable extends Migration | ||
{ | ||
public function up() | ||
{ | ||
$this->forge->addField([ | ||
'id' => [ | ||
'type' => 'INT', | ||
'unsigned' => true, | ||
'auto_increment' => true | ||
], | ||
'fk_user_group_id' => [ | ||
'type' => 'INT', | ||
'unsigned' => true, | ||
'null' => true | ||
], | ||
'fk_user_sync_id' => [ | ||
'type' => 'INT', | ||
'null' => true | ||
], | ||
'fk_event_type_id' => [ | ||
'type' => 'INT', | ||
'unsigned' => true | ||
], | ||
'event_date' => [ | ||
'type' => 'DATE' | ||
], | ||
'start_time' => [ | ||
'type' => 'TIME' | ||
], | ||
'end_time' => [ | ||
'type' => 'TIME' | ||
], | ||
'is_work_time' => [ | ||
'type' => 'BOOLEAN' | ||
], | ||
]); | ||
|
||
$this->forge->addKey('id', true); | ||
$this->forge->addForeignKey('fk_user_group_id', 'user_group', 'id'); | ||
$this->forge->addForeignKey('fk_user_sync_id', 'user_sync', 'id_user'); | ||
$this->forge->addForeignKey('fk_event_type_id', 'event_type', 'id'); | ||
$this->forge->createTable('event_planning', true); | ||
} | ||
|
||
public function down() | ||
{ | ||
// | ||
} | ||
} |