Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use Propel\Generator\Manager\MigrationManager;
- /**
- * Data object containing the SQL and PHP code to migrate the database
- * up to version 1465748871.
- */
- class PropelMigration_1465748871
- {
- public $comment = '';
- public function preUp(MigrationManager $manager)
- {
- // add the pre-migration code here
- }
- public function postUp(MigrationManager $manager)
- {
- // add the post-migration code here
- }
- public function preDown(MigrationManager $manager)
- {
- // add the pre-migration code here
- }
- public function postDown(MigrationManager $manager)
- {
- // add the post-migration code here
- }
- /**
- * Get the SQL statements for the Up migration
- *
- * @return array list of the SQL strings to execute for the Up migration
- * the keys being the datasources
- */
- public function getUpSQL()
- {
- return array (
- 'default' => '
- BEGIN;
- ALTER TABLE "product"
- ADD "id_product" bigserial NOT NULL,
- ADD "id_product_barcode" INT8,
- ADD "name" VARCHAR(200) NOT NULL,
- ADD "id_product_manufacturer" INTEGER NOT NULL,
- ADD "id_product_category" INTEGER NOT NULL,
- ADD "id_product_photo" INT8,
- ADD PRIMARY KEY ("id_product");
- COMMIT;
- ',
- );
- }
- /**
- * Get the SQL statements for the Down migration
- *
- * @return array list of the SQL strings to execute for the Down migration
- * the keys being the datasources
- */
- public function getDownSQL()
- {
- return array (
- 'default' => '
- BEGIN;
- ALTER TABLE "product"
- DROP CONSTRAINT "product_pkey",
- DROP COLUMN "id_product",
- DROP COLUMN "id_product_barcode",
- DROP COLUMN "name",
- DROP COLUMN "id_product_manufacturer",
- DROP COLUMN "id_product_category",
- DROP COLUMN "id_product_photo";
- COMMIT;
- ',
- );
- }
- }
Add Comment
Please, Sign In to add comment