Guest User

Untitled

a guest
Jun 12th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.76 KB | None | 0 0
  1. <?php
  2.  
  3. use Propel\Generator\Manager\MigrationManager;
  4.  
  5. /**
  6.  * Data object containing the SQL and PHP code to migrate the database
  7.  * up to version 1465748868.
  8.  * Generated on 2016-06-12 18:27:48 by w
  9.  */
  10. class PropelMigration_1465748868
  11. {
  12.     public $comment = '';
  13.  
  14.     public function preUp(MigrationManager $manager)
  15.     {
  16.         // add the pre-migration code here
  17.     }
  18.  
  19.     public function postUp(MigrationManager $manager)
  20.     {
  21.         // add the post-migration code here
  22.     }
  23.  
  24.     public function preDown(MigrationManager $manager)
  25.     {
  26.         // add the pre-migration code here
  27.     }
  28.  
  29.     public function postDown(MigrationManager $manager)
  30.     {
  31.         // add the post-migration code here
  32.     }
  33.  
  34.     /**
  35.      * Get the SQL statements for the Up migration
  36.      *
  37.      * @return array list of the SQL strings to execute for the Up migration
  38.      *               the keys being the datasources
  39.      */
  40.     public function getUpSQL()
  41.     {
  42.         return array (
  43.   'default' => '
  44. BEGIN;
  45.  
  46. CREATE TABLE "product"
  47. (
  48.    "id_product" bigserial NOT NULL,
  49.    "id_product_barcode" INT8,
  50.    "name" VARCHAR(200) NOT NULL,
  51.    "id_product_manufacturer" INTEGER NOT NULL,
  52.    "id_product_category" INTEGER NOT NULL,
  53.    "id_product_photo" INT8,
  54.    PRIMARY KEY ("id_product")
  55. );
  56.  
  57. COMMENT ON TABLE "product" IS \'Available products table\';
  58.  
  59. COMMIT;
  60. ',
  61. );
  62.     }
  63.  
  64.     /**
  65.      * Get the SQL statements for the Down migration
  66.      *
  67.      * @return array list of the SQL strings to execute for the Down migration
  68.      *               the keys being the datasources
  69.      */
  70.     public function getDownSQL()
  71.     {
  72.         return array (
  73.   'default' => '
  74. BEGIN;
  75.  
  76. DROP TABLE IF EXISTS "product" CASCADE;
  77.  
  78. COMMIT;
  79. ',
  80. );
  81.     }
  82.  
  83. }
Add Comment
Please, Sign In to add comment