<?php 

use Phalcon\Db\Column;
use Phalcon\Db\Index;
use Phalcon\Db\Reference;
use Phalcon\Mvc\Model\Migration;

/**
 * Class Public.profilesMigration_100
 */
class profilesMigration_100 extends Migration
{
    /**
     * Define the table structure
     *
     * @return void
     */
    public function morph()
    {
        
    }

    /**
     * Run the migrations
     *
     * @return void
     */
    public function up()
    {
		self::$connection->execute('
			create extension IF NOT EXISTS "uuid-ossp";

			CREATE TABLE public.profiles
			(
			  id uuid NOT NULL DEFAULT uuid_generate_v4(),
			  name character varying(64) NOT NULL,
			  active boolean NOT NULL DEFAULT true,
			  created timestamp without time zone DEFAULT now(),
			  creator uuid,
			  last_update timestamp without time zone,
			  last_updater uuid,
			  CONSTRAINT profiles_pkey PRIMARY KEY (id)
			)
			WITH (
			  OIDS=FALSE
			);
			ALTER TABLE public.profiles
			  OWNER TO postgres;

			insert into public.profiles values (\'e3bc7d6f-b0f6-46de-b271-25b7497ad9f7\',\'Super Admin\', true, now(), NULL, NULL, NULL);
			insert into public.profiles values (\'ec26d5f5-244a-458f-a473-1e876b66c6a0\',\'Public\', true, now(), NULL, NULL, NULL);
		');
    }

    /**
     * Reverse the migrations
     *
     * @return void
     */
    public function down()
    {

    }

}
