Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Updating the version
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Downey committed Mar 7, 2012
1 parent d0b7ec8 commit 6e9f6b8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions bonfire/application/config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');


define('BONFIRE_VERSION', 'v0.5');
define('BONFIRE_VERSION', 'v0.5.1');

/*
The 'App Area' allows you to specify the base folder used for all of
The 'App Area' allows you to specify the base folder used for all of
the contexts in the app. By default, this is set to '/admin', but this
does not make sense for all applications.
does not make sense for all applications.
*/
define('SITE_AREA', 'admin');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

// There are no doubt more types where a value/length isn't possible - needs investigating
$no_length = array('TEXT', 'BOOL', 'DATE', 'DATETIME', 'BLOB', 'TINYBLOB', 'TINYTEXT', 'MEDIUMBLOB', 'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT');
$no_length = array('TEXT', 'BOOL', 'DATE', 'DATETIME', 'TIMESTAMP', 'BLOB', 'TINYBLOB', 'TINYTEXT', 'MEDIUMBLOB', 'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT');

$db_migration = '<?php if (!defined(\'BASEPATH\')) exit(\'No direct script access allowed\');
class Migration_Install_'.$table_name.' extends Migration {
public function up()
public function up()
{
$prefix = $this->db->dbprefix;
Expand All @@ -22,58 +22,58 @@ public function up()

$db_migration .= '
$this->dbforge->add_field("`'.$module_name_lower.'_'.set_value("view_field_name$counter").'` '.addcslashes(set_value("db_field_type$counter"),'"');

if (!in_array(set_value("db_field_type$counter"), $no_length))
{
$db_migration .= '('.addcslashes($this->input->post("db_field_length_value$counter"),'"').')';
}


$db_migration .= ' NOT NULL");';

}

// use soft deletes? Add deleted field.
if ($this->input->post('use_soft_deletes') == 'true')
{
$db_migration .= '
$this->dbforge->add_field("`deleted` INT(11) NOT NULL DEFAULT \'0\'");';
}

// use the created field? Add field and custom name if chosen.
if ($this->input->post('use_created') == 'true')
{
$created_field = ($this->input->post('created_field')) ? $this->input->post('created_field') : 'created_on';
$db_migration .= '
$this->dbforge->add_field("`'.$created_field.'` datetime NOT NULL DEFAULT \'0000-00-00 00:00:00\'");';
$this->dbforge->add_field("`'.$created_field.'` datetime NOT NULL DEFAULT \'0000-00-00 00:00:00\'");';
}

// use the created field? Add field and custom name if chosen.
if ($this->input->post('use_modified') == 'true')
{
$modified_field = ($this->input->post('modified_field')) ? $this->input->post('modified_field') : 'modified_on';
$db_migration .= '
$this->dbforge->add_field("`'.$modified_field.'` datetime NOT NULL DEFAULT \'0000-00-00 00:00:00\'");';
$this->dbforge->add_field("`'.$modified_field.'` datetime NOT NULL DEFAULT \'0000-00-00 00:00:00\'");';
}

$db_migration .= '
$this->dbforge->add_key(\''.$primary_key_field.'\', true);
$this->dbforge->create_table(\''.$table_name.'\');
}
//--------------------------------------------------------------------
public function down()
public function down()
{
$prefix = $this->db->dbprefix;
$this->dbforge->drop_table(\''.$table_name.'\');
}
//--------------------------------------------------------------------
}';

echo $db_migration;
Expand Down
6 changes: 3 additions & 3 deletions install/config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');


define('BONFIRE_VERSION', 'v0.5');
define('BONFIRE_VERSION', 'v0.5.1');

/*
The 'App Area' allows you to specify the base folder used for all of
The 'App Area' allows you to specify the base folder used for all of
the contexts in the app. By default, this is set to '/admin', but this
does not make sense for all applications.
does not make sense for all applications.
*/
define('SITE_AREA', 'admin');

Expand Down

0 comments on commit 6e9f6b8

Please sign in to comment.