diff --git a/app/migrations/20180321115827_create_user_table.php b/app/migrations/20180321115827_create_user_table.php new file mode 100644 index 0000000..c79e002 --- /dev/null +++ b/app/migrations/20180321115827_create_user_table.php @@ -0,0 +1,34 @@ +table('user'); + + $table->addColumn('username', 'string', [ + 'limit' => 50, + 'null' => false + ]); + + $table->addColumn('email', 'string', [ + 'limit' => 255, + 'null' => false + ]); + + $table->addColumn('status', 'enum', [ + 'null' => false, + 'default' => 'Active', + 'values' => [ 'Active', 'Deleted', 'Suspended'] + ]); + + $table->addColumn('password', 'string', [ + 'limit' => 255, + 'null' => true, + ]); + + $table->save(); + } +} diff --git a/app/migrations/20180321131740_create_callback_table.php b/app/migrations/20180321131740_create_callback_table.php new file mode 100644 index 0000000..9de7884 --- /dev/null +++ b/app/migrations/20180321131740_create_callback_table.php @@ -0,0 +1,36 @@ +table('callback'); + $table->addColumn('public_id', 'string', [ + 'length' => 12, + 'null' => false, + ])->addIndex('public_id', [ 'name' => 'UNIQUE_public_id', 'unique' => true ]); + + $table->addColumn('userid', 'integer', [ + 'null' => true, + ])->addForeignKey('userid', 'user', ['id'], [ 'constraint' => 'FK_user' ]); + + $table->addColumn('name', 'string', [ + 'length' => 64, + 'null' => false, + ]); + + $table->addColumn('created_at', 'timestamp', [ + 'default' => 'CURRENT_TIMESTAMP' + ]); + + $table->addColumn('last_request', 'timestamp', [ + 'default' => null, + 'null' => true + ]); + + $table->save(); + } +} diff --git a/app/migrations/20180321133533_create_request_meta_table.php b/app/migrations/20180321133533_create_request_meta_table.php new file mode 100644 index 0000000..124eb5f --- /dev/null +++ b/app/migrations/20180321133533_create_request_meta_table.php @@ -0,0 +1,39 @@ +table('request_meta'); + + $table->addColumn('callbackid', 'integer'); + $table->addForeignKey('callbackid', 'callback', [ 'id' ], + [ 'constraint' => 'FK_callback' ]); + + $table->addColumn('source_ip', 'string', [ + 'limit' => 50, + 'null' => true, + ]); + + $table->addColumn('method', 'enum', [ + 'null' => false, + 'default' => 'GET', + 'values' => [ 'GET', 'POST' ] + ]); + + $table->addColumn('uri', 'string', [ + 'limit' => 255, + 'null' => true, + ]); + + $table->addColumn('timestamp', 'timestamp', [ + 'default' => 'CURRENT_TIMESTAMP', + 'null' => false, + ]); + + $table->save(); + } +} diff --git a/app/migrations/20180321133715_create_request_object_table.php b/app/migrations/20180321133715_create_request_object_table.php new file mode 100644 index 0000000..29aea46 --- /dev/null +++ b/app/migrations/20180321133715_create_request_object_table.php @@ -0,0 +1,25 @@ +table('request_object'); + + $table->addForeignKey('id', 'request_meta', ['id'], + [ 'constraint' => 'FK_request_meta' ]); + + $table->addColumn('headers', 'blob', [ + 'null' => true, + ]); + + $table->addColumn('body', 'blob', [ + 'null' => true, + ]); + + $table->save(); + } +}