From 5c3363f20e7fc8a8050cfe8d550876abb51cb074 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Fri, 12 Sep 2025 13:34:45 +0700 Subject: [PATCH] adding orders migration --- .../Migrations/2025-09-12-100001_Orders.php | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 app/Database/Migrations/2025-09-12-100001_Orders.php diff --git a/app/Database/Migrations/2025-09-12-100001_Orders.php b/app/Database/Migrations/2025-09-12-100001_Orders.php new file mode 100644 index 0000000..ff671a4 --- /dev/null +++ b/app/Database/Migrations/2025-09-12-100001_Orders.php @@ -0,0 +1,76 @@ +forge->addField([ + 'InternalOID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], + 'OrderID' => ['type' => 'VARCHAR', 'contstraint'=> 22, 'null' => false], + 'PlacerID' => ['type' => 'VARCHAR', 'contstraint'=> 22, 'null' => true], + 'InternalPID' => ['type' => 'INT', 'null' => false], + 'SiteID' => ['type' => 'VARCHAR', 'contstraint'=> 15, 'null' => false], + 'PVADTID' => ['type' => 'INT', 'null' => false], + 'ReqApp' => ['type' => 'VARCHAR', 'contstraint'=> 15, 'null' => true], + 'LocationID' => ['type' => 'INT', 'null' => false], + 'Priority' => ['type' => 'VARCHAR', 'constraint' => 50, 'null' => true], + 'TrnDate' => ['type' => 'Datetime', 'null' => true], + 'EffDate' => ['type' => 'Datetime', 'null' => true], + 'CreateDate' => ['type' => 'Datetime', 'null' => true], + 'EndDate' => ['type' => 'Datetime', 'null' => true], + 'ArchiveDate' => ['type' => 'Datetime', 'null' => true], + 'DelDate' => ['type' => 'Datetime', 'null' => true] + ]); + $this->forge->addKey('InternalOID', true); + $this->forge->addUniqueKey('OrderID', true); + $this->forge->createTable('ordertest'); + + $this->forge->addField([ + 'InternalOID' => ['type' => 'INT', 'null' => false], + 'OrderComID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], + 'Comment' => ['type' => 'text', 'null' => true], + 'UserID' => ['type' => 'INT', 'null' => false], + 'CreateDate' => ['type' => 'Datetime', 'null' => true], + 'EndDate' => ['type' => 'Datetime', 'null' => true], + 'ArchiveDate' => ['type' => 'Datetime', 'null' => true], + 'DelDate' => ['type' => 'Datetime', 'null' => true] + ]); + $this->forge->addKey('OrderComID', true); + $this->forge->createTable('ordercom'); + + $this->forge->addField([ + 'InternalOID' => ['type' => 'INT', 'null' => false], + 'OrderAttID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], + 'Address' => ['type' => 'varchar', 'constraint'=>255, 'null' => true], + 'UserID' => ['type' => 'INT', 'null' => false], + 'CreateDate' => ['type' => 'Datetime', 'null' => true], + 'EndDate' => ['type' => 'Datetime', 'null' => true], + 'ArchiveDate' => ['type' => 'Datetime', 'null' => true], + 'DelDate' => ['type' => 'Datetime', 'null' => true] + ]); + $this->forge->addKey('OrderAttID', true); + $this->forge->createTable('orderatt'); + + $this->forge->addField([ + 'InternalOID' => ['type' => 'INT', 'null' => false], + 'OrderStatID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], + 'OrderStatus' => ['type' => 'varchar', 'constraint'=>2, 'null' => false], + 'CreateDate' => ['type' => 'Datetime', 'null' => true], + 'EndDate' => ['type' => 'Datetime', 'null' => true], + 'ArchiveDate' => ['type' => 'Datetime', 'null' => true], + 'DelDate' => ['type' => 'Datetime', 'null' => true] + ]); + $this->forge->addKey('OrderStatID', true); + $this->forge->createTable('orderstatus'); + + } + + public function down() { + $this->forge->dropTable('ordertest'); + $this->forge->dropTable('ordercom'); + $this->forge->dropTable('orderatt'); + $this->forge->dropTable('orderstatus'); + } +} \ No newline at end of file