Skip to content

Commit

Permalink
updated gitignore
Browse files Browse the repository at this point in the history
	created migration file

	modified:   .gitignore
	new file:   config/Migrations/20160504083509_Initial.php
  • Loading branch information
robjuz committed May 4, 2016
1 parent ac4ca77 commit f6df4f5
Show file tree
Hide file tree
Showing 2 changed files with 158 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/config/app.php
/tmp/*
/logs/*
.idea/*
157 changes: 157 additions & 0 deletions config/Migrations/20160504085859_Initial.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
<?php
use Migrations\AbstractMigration;

class Initial extends AbstractMigration
{
public function change()
{
$table = $this->table('kovicky_categories');
$table
->addColumn('parent_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
])
->addColumn('rght', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
])
->addColumn('lft', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
])
->addColumn('title', 'string', [
'default' => null,
'limit' => 45,
'null' => false,
])
->addColumn('created', 'datetime', [
'default' => null,
'limit' => null,
'null' => true,
])
->addColumn('modified', 'datetime', [
'default' => null,
'limit' => null,
'null' => true,
])
->create();

$table = $this->table('kovicky_mediafiles');
$table
->addColumn('kovicky_solution_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
])
->addColumn('user_id', 'integer', [
'default' => 1,
'limit' => 11,
'null' => false,
])
->addColumn('file_name', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('file_url', 'string', [
'default' => null,
'limit' => 255,
'null' => true,
])
->addColumn('created', 'datetime', [
'default' => null,
'limit' => null,
'null' => true,
])
->addColumn('modified', 'datetime', [
'default' => null,
'limit' => null,
'null' => true,
])
->create();

$table = $this->table('kovicky_problems');
$table
->addColumn('user_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
])
->addColumn('kovicky_category_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => false,
])
->addColumn('title', 'string', [
'default' => null,
'limit' => 60,
'null' => true,
])
->addColumn('thesis', 'text', [
'default' => null,
'limit' => null,
'null' => true,
])
->addColumn('description', 'text', [
'default' => null,
'limit' => null,
'null' => true,
])
->addColumn('created', 'datetime', [
'default' => null,
'limit' => null,
'null' => true,
])
->addColumn('modified', 'datetime', [
'default' => null,
'limit' => null,
'null' => true,
])
->create();

$table = $this->table('kovicky_solutions');
$table
->addColumn('kovicky_problem_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
])
->addColumn('user_id', 'integer', [
'default' => null,
'limit' => 11,
'null' => true,
])
->addColumn('description', 'text', [
'default' => null,
'limit' => null,
'null' => true,
])
->addColumn('created', 'datetime', [
'default' => null,
'limit' => null,
'null' => true,
])
->addColumn('modified', 'datetime', [
'default' => null,
'limit' => null,
'null' => true,
])
->addColumn('is_active', 'boolean', [
'default' => 0,
'limit' => null,
'null' => true,
])
->create();
}

public function down()
{
$this->droptable('kovicky_categories');
$this->droptable('kovicky_mediafiles');
$this->droptable('kovicky_problems');
$this->droptable('kovicky_solutions');
}
}

0 comments on commit f6df4f5

Please sign in to comment.