Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

very first version of the dashboard app #2

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
added data to schema file
  • Loading branch information
vistik committed Sep 29, 2011
commit f5b4b9f379cfa663be967f594d5de20c43c01143
91 changes: 56 additions & 35 deletions app/config/schema/schema.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,58 @@
<?php
/* App schema generated on: 2011-09-29 23:01:31 : 1317330091*/
<?php

/* App schema generated on: 2011-09-29 23:01:31 : 1317330091 */

class AppSchema extends CakeSchema {
var $name = 'App';

function before($event = array()) {
return true;
}

function after($event = array()) {
}

var $users = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'password' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'email' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM')
);
var $users_widgets = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'user_id' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'widget_id' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'visible' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM')
);
var $widgets = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'order' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM')
);

var $name = 'App';

function before($event = array()) {
return true;
}

function after($event = array()) {
$db = &ConnectionManager::getDataSource($this->connection);

if (isset($event["create"]) && $event['create'] == 'users') {
$db->execute("INSERT INTO `users` (`id`, `name`, `password`, `email`) VALUES
(1, 'visti', 'admin', '[email protected]'),
(2, 's\�ren', 'admin', '[email protected]');");
} elseif (isset($event["create"]) && $event['create'] == 'widgets') {
$db->execute("INSERT INTO `widgets` (`id`, `name`, `order`) VALUES
(1, 'Calendar', 1),
(2, 'Blogs', 2);");
} elseif(isset($event["create"]) && $event['create'] == 'users_widgets'){
$db->execute("INSERT INTO `users_widgets` (`id`, `user_id`, `widget_id`, `visible`) VALUES
(1, 1, 1, 0),
(2, 1, 2, 0),
(3, 2, 1, 0);");
}
}

var $users = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'password' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'email' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM')
);
var $users_widgets = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'user_id' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'widget_id' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'visible' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM')
);
var $widgets = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => NULL, 'key' => 'primary'),
'name' => array('type' => 'string', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'order' => array('type' => 'integer', 'null' => false, 'default' => NULL),
'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'MyISAM')
);

}
?>

?>