Browse Source

Database added

master
Rogier Neeleman 8 years ago
parent
commit
65e0f02d73
  1. 42
      application/migrations/20160310160700_add_groep.php
  2. 56
      application/migrations/20160310161000_add_subgroep.php
  3. 53
      application/migrations/20160310161500_add_lijst.php
  4. 43
      application/migrations/20160310162100_add_spelgebied.php
  5. 48
      application/migrations/20160310162300_add_onderdeel.php
  6. 68
      application/migrations/20160310162500_add_vragen.php
  7. 64
      application/migrations/20160310162800_add_resultaat.php

42
application/migrations/20160310160700_add_groep.php

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Add regio table
*/
class Migration_Add_groep extends CI_Migration
{
public function up()
{
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'constraint' => '5',
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'regioid' => array(
'type' => 'INT',
'constraint' => '3',
'unsigned' => TRUE,
),
'naam' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
'plaats' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
));
$this->dbforge->add_key('id', TRUE);
$this->dbforge->create_table('groep');
}
public function down()
{
$this->dbforge->drop_table('groep');
}
}

56
application/migrations/20160310161000_add_subgroep.php

@ -0,0 +1,56 @@ @@ -0,0 +1,56 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Add regio table
*/
class Migration_Add_subgroep extends CI_Migration
{
public function up()
{
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'constraint' => '5',
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'regioid' => array(
'type' => 'INT',
'constraint' => '3',
'unsigned' => TRUE,
),
'groepid' => array(
'type' => 'INT',
'constraint' => '5',
'unsigned' => TRUE,
),
'jaar' => array(
'type' => 'INT',
'constraint' => '4',
'unsigned' => TRUE,
),
'naam' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
'themanaam' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
'nummer' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
));
$this->dbforge->add_key('id', TRUE);
$this->dbforge->create_table('subgroep');
}
public function down()
{
$this->dbforge->drop_table('subgroep');
}
}

53
application/migrations/20160310161500_add_lijst.php

@ -0,0 +1,53 @@ @@ -0,0 +1,53 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Add regio table
*/
class Migration_Add_lijst extends CI_Migration
{
public function up()
{
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'regioid' => array(
'type' => 'INT',
'constraint' => '3',
'unsigned' => TRUE,
),
'jaar' => array(
'type' => 'INT',
'unsigned' => TRUE,
'constraint' => '4',
),
'naam' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
'ronde' => array(
'type' => 'INT',
'constraint' => '1',
'unsigned' => TRUE,
),
'actief' => array(
'type' => 'INT',
'constraint' => '1',
'unsigned' => TRUE,
),
));
$this->dbforge->add_key('id', TRUE);
$this->dbforge->create_table('lijst');
}
public function down()
{
$this->dbforge->drop_table('lijst');
}
}

43
application/migrations/20160310162100_add_spelgebied.php

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Add regio table
*/
class Migration_Add_spelgebied extends CI_Migration
{
public function up()
{
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'regioid' => array(
'type' => 'INT',
'constraint' => '3',
'unsigned' => TRUE,
),
'jaar' => array(
'type' => 'INT',
'unsigned' => TRUE,
'constraint' => '4',
),
'naam' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
));
$this->dbforge->add_key('id', TRUE);
$this->dbforge->create_table('spelgebied');
}
public function down()
{
$this->dbforge->drop_table('spelgebied');
}
}

48
application/migrations/20160310162300_add_onderdeel.php

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Add regio table
*/
class Migration_Add_onderdeel extends CI_Migration
{
public function up()
{
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'regioid' => array(
'type' => 'INT',
'constraint' => '3',
'unsigned' => TRUE,
),
'spelgebiedid' => array(
'type' => 'INT',
'constraint' => '3',
'unsigned' => TRUE,
),
'jaar' => array(
'type' => 'INT',
'unsigned' => TRUE,
'constraint' => '4',
),
'naam' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
));
$this->dbforge->add_key('id', TRUE);
$this->dbforge->create_table('onderdeel');
}
public function down()
{
$this->dbforge->drop_table('onderdeel');
}
}

68
application/migrations/20160310162500_add_vragen.php

@ -0,0 +1,68 @@ @@ -0,0 +1,68 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Add regio table
*/
class Migration_Add_vragen extends CI_Migration
{
public function up()
{
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'regioid' => array(
'type' => 'INT',
'constraint' => '3',
'unsigned' => TRUE,
),
'onderdeelid' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
),
'lijstid' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
),
'volgorde' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
),
'jaar' => array(
'type' => 'INT',
'unsigned' => TRUE,
'constraint' => '4',
),
'vraag' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
'antwoord' => array(
'type' => 'INT',
'constraint' => '1',
'unsigned' => TRUE,
),
'score' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
),
));
$this->dbforge->add_key('id', TRUE);
$this->dbforge->create_table('vragen');
}
public function down()
{
$this->dbforge->drop_table('vragen');
}
}

64
application/migrations/20160310162800_add_resultaat.php

@ -0,0 +1,64 @@ @@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Add regio table
*/
class Migration_Add_resultaat extends CI_Migration
{
public function up()
{
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
'auto_increment' => TRUE,
),
'regioid' => array(
'type' => 'INT',
'constraint' => '3',
'unsigned' => TRUE,
),
'vraagid' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
),
'ronde' => array(
'type' => 'INT',
'constraint' => '1',
'unsigned' => TRUE,
),
'subgroepid' => array(
'type' => 'INT',
'constraint' => '5',
),
'timestamp' => array(
'type' => 'DATETIME',
),
'score' => array(
'type' => 'INT',
'constraint' => '6',
'unsigned' => TRUE,
),
'userid' => array(
'type' => 'INT',
'constraint' => '4',
),
'lokatie' => array(
'type' => 'VARCHAR',
'constraint' => '80',
),
));
$this->dbforge->add_key('id', TRUE);
$this->dbforge->create_table('resultaat');
}
public function down()
{
$this->dbforge->drop_table('resultaat');
}
}
Loading…
Cancel
Save