Working with Laravel 5.5 Migrations with Postgres :
1) Defining field as :
$table->enum('is_applied', ['Y', 'N']) ->comment('Y => is_applied, N=> Is not applied');
I see in generated table next:
is_applied varchar(255) NOT NULL,
CONSTRAINT cs_tmp_csvps_is_applied_check CHECK (((is_applied)::text = ANY ((ARRAY['Y'::character varying, 'N'::character varying])::text[]))),
actually I would like to get sql I used in Postgres with type:
CREATE TYPE type_cms_item_content_type AS ENUM (
'P',
'M',
'H'
);
content_type type_cms_item_content_type NOT NULL DEFAULT 'P'::type_cms_item_content_type,
Is it possible?
2) Defining field as :
$table->timestamps();
I have 2 fields created created_at and updated_at . As I need to create only created_at I could write :
$table->dateTime('created_at');
But is there is a way to set default time on server, like :
created_at timestamp NOT NULL DEFAULT now(),
?
Thanks!