Permalink
Browse files

updating to use default migrations

  • Loading branch information...
1 parent d966f14 commit 0ff1d551f2095c66b4c7f1958fed9f517a483b6f @dogmatic69 committed Mar 25, 2013
@@ -0,0 +1,102 @@
+<?php
+class Init extends CakeMigration {
+
+/**
+ * Migration description
+ *
+ * @var string
+ * @access public
+ */
+ public $description = '';
+
+/**
+ * Actions to be performed
+ *
+ * @var array $migration
+ * @access public
+ */
+ public $migration = array(
+ 'up' => array(
+ 'create_table' => array(
+ 'infinitas_job_logs' => array(
+ 'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'message' => array('type' => 'text', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'infinitas_job_id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'error' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
+ 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'indexes' => array(
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1),
+ ),
+ 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB'),
+ ),
+ 'infinitas_job_queues' => array(
+ 'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_bin', 'charset' => 'utf8'),
+ 'name' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 50, 'key' => 'unique', 'collate' => 'utf8_bin', 'charset' => 'utf8'),
+ 'slug' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 50, 'collate' => 'utf8_bin', 'charset' => 'utf8'),
+ 'max_attempts' => array('type' => 'integer', 'null' => false, 'default' => '5', 'length' => 5),
+ 'sleep_between' => array('type' => 'integer', 'null' => false, 'default' => '5', 'length' => 5),
+ 'retry_delay' => array('type' => 'integer', 'null' => false, 'default' => '7200', 'length' => 8),
+ 'pending_job_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
+ 'failed_job_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
+ 'locked_job_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
+ 'completed_job_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
+ 'pid' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 5),
+ 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'indexes' => array(
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1),
+ 'name' => array('column' => 'name', 'unique' => 1),
+ ),
+ 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_bin', 'engine' => 'InnoDB'),
+ ),
+ 'infinitas_jobs' => array(
+ 'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'infinitas_job_queue_id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'host' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 150, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'pid' => array('type' => 'string', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'handler' => array('type' => 'text', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'attempts' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 5),
+ 'run_at' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'completed' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'locked' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'failed' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'infinitas_job_error_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 3),
+ 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'indexes' => array(
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1),
+ ),
+ 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB'),
+ ),
+ ),
+ ),
+ 'down' => array(
+ 'drop_table' => array(
+ 'infinitas_job_logs', 'infinitas_job_queues', 'infinitas_jobs'
+ ),
+ ),
+ );
+
+/**
+ * Before migration callback
+ *
+ * @param string $direction, up or down direction of migration process
+ * @return boolean Should process continue
+ * @access public
+ */
+ public function before($direction) {
+ return true;
+ }
+
+/**
+ * After migration callback
+ *
+ * @param string $direction, up or down direction of migration process
+ * @return boolean Should process continue
+ * @access public
+ */
+ public function after($direction) {
+ return true;
+ }
+}
View
@@ -1,4 +1,4 @@
-<?php
+<?php
class InfinitasJobsSchema extends CakeSchema {
public function before($event = array()) {
@@ -9,47 +9,54 @@ public function after($event = array()) {
}
public $infinitas_job_logs = array(
- 'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'message' => array('type' => 'text', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'infinitas_job_id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'message' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'infinitas_job_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'error' => array('type' => 'boolean', 'null' => false, 'default' => '1'),
- 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
+ 'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
+ 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
+ 'indexes' => array(
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1)
+ ),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
public $infinitas_job_queues = array(
- 'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_bin', 'charset' => 'utf8'),
- 'name' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 50, 'key' => 'unique', 'collate' => 'utf8_bin', 'charset' => 'utf8'),
- 'slug' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 50, 'collate' => 'utf8_bin', 'charset' => 'utf8'),
+ 'id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_bin', 'charset' => 'utf8'),
+ 'name' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 50, 'key' => 'unique', 'collate' => 'utf8_bin', 'charset' => 'utf8'),
+ 'slug' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 50, 'collate' => 'utf8_bin', 'charset' => 'utf8'),
'max_attempts' => array('type' => 'integer', 'null' => false, 'default' => '5', 'length' => 5),
'sleep_between' => array('type' => 'integer', 'null' => false, 'default' => '5', 'length' => 5),
'retry_delay' => array('type' => 'integer', 'null' => false, 'default' => '7200', 'length' => 8),
'pending_job_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
'failed_job_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
'locked_job_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
'completed_job_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 8),
- 'pid' => array('type' => 'integer', 'null' => true, 'default' => NULL, 'length' => 5),
- 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1), 'name' => array('column' => 'name', 'unique' => 1)),
+ 'pid' => array('type' => 'integer', 'null' => true, 'default' => null, 'length' => 5),
+ 'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
+ 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
+ 'indexes' => array(
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1),
+ 'name' => array('column' => 'name', 'unique' => 1)
+ ),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_bin', 'engine' => 'InnoDB')
);
public $infinitas_jobs = array(
- 'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'infinitas_job_queue_id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'host' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 150, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'pid' => array('type' => 'string', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'handler' => array('type' => 'text', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'infinitas_job_queue_id' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 36, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'host' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 150, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'pid' => array('type' => 'string', 'null' => true, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
+ 'handler' => array('type' => 'text', 'null' => false, 'default' => null, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
'attempts' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 5),
- 'run_at' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'completed' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'locked' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'failed' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
+ 'run_at' => array('type' => 'datetime', 'null' => true, 'default' => null),
+ 'completed' => array('type' => 'datetime', 'null' => true, 'default' => null),
+ 'locked' => array('type' => 'datetime', 'null' => true, 'default' => null),
+ 'failed' => array('type' => 'datetime', 'null' => true, 'default' => null),
'infinitas_job_error_count' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 3),
- 'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'modified' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'indexes' => array('PRIMARY' => array('column' => 'id', 'unique' => 1)),
+ 'created' => array('type' => 'datetime', 'null' => true, 'default' => null),
+ 'modified' => array('type' => 'datetime', 'null' => true, 'default' => null),
+ 'indexes' => array(
+ 'PRIMARY' => array('column' => 'id', 'unique' => 1)
+ ),
'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB')
);
}
View
@@ -1 +0,0 @@
-{"id":"5025228c-45bc-45d2-89fa-78136318cd70","name":"InfinitasJobs","update_url":"infinitas-cms.org\/plugins\/version\/plugin:infinitas_jobs","version":"0.1.1","dependancies":[],"author":"Jose Diaz-Gonzalez","website":"http:\/\/josediazgonzalez.com\/","description":"Quick and easy job queues, based on delayed_job","license":"MIT"}
@@ -1,82 +0,0 @@
-<?php
- /**
- * Infinitas Releas
- *
- * Auto generated database update
- */
-
- class R502522b18c204317850f78136318cd70 extends CakeRelease {
-
- /**
- * Migration description
- *
- * @var string
- * @access public
- */
- public $description = 'Migration for InfinitasJobs version 0.1';
-
- /**
- * Plugin name
- *
- * @var string
- * @access public
- */
- public $plugin = 'InfinitasJobs';
-
- /**
- * Actions to be performed
- *
- * @var array $migration
- * @access public
- */
- public $migration = array(
- 'up' => array(
- 'create_table' => array(
- 'infinitas_jobs' => array(
- 'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'handler' => array('type' => 'text', 'null' => false, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'queue' => array('type' => 'string', 'null' => false, 'default' => 'default', 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'attempts' => array('type' => 'integer', 'null' => false, 'default' => '0', 'length' => 10),
- 'run_at' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'locked_at' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'locked_by' => array('type' => 'string', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'failed_at' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
- 'error' => array('type' => 'text', 'null' => true, 'default' => NULL, 'collate' => 'utf8_general_ci', 'charset' => 'utf8'),
- 'created_at' => array('type' => 'datetime', 'null' => false, 'default' => NULL),
- 'indexes' => array(
- 'PRIMARY' => array('column' => 'id', 'unique' => 1),
- ),
- 'tableParameters' => array('charset' => 'utf8', 'collate' => 'utf8_general_ci', 'engine' => 'InnoDB'),
- ),
- ),
- ),
- 'down' => array(
- 'drop_table' => array(
- 'infinitas_jobs'
- ),
- ),
- );
-
-
- /**
- * Before migration callback
- *
- * @param string $direction, up or down direction of migration process
- * @return boolean Should process continue
- * @access public
- */
- public function before($direction) {
- return true;
- }
-
- /**
- * After migration callback
- *
- * @param string $direction, up or down direction of migration process
- * @return boolean Should process continue
- * @access public
- */
- public function after($direction) {
- return true;
- }
- }
Oops, something went wrong.

0 comments on commit 0ff1d55

Please sign in to comment.