Closed rebin closed 7 years ago
Hi @rebin,
Could you provide the CREATE TABLE
statement of the table that is causing this issue?
Also, this is a duplicate of #26.
Schema::create('vessel', function(Blueprint $table) { $table->bigInteger('id', true); $table->string('vessel_name', 50); $table->string('imo', 15)->nullable(); $table->bigInteger('vessel_type_id'); $table->bigInteger('shipping_agent_id')->nullable(); $table->bigInteger('shipping_line_id')->nullable(); $table->bigInteger('flag_id'); $table->string('call_sign', 7); $table->string('mmsi', 9)->nullable(); $table->decimal('loa', 6, 3); $table->decimal('beam', 4)->nullable(); $table->decimal('air_draught', 4)->nullable(); $table->string('photo_url')->nullable(); $table->boolean('deleted')->default(''); $table->bigInteger('user_id'); $table->timestamps(); $table->char('profile_status')->default('B'); });
On Mon, Oct 6, 2014 at 6:57 PM, tomzx notifications@github.com wrote:
Hi @rebin https://github.com/rebin,
Could you provide the CREATE TABLE statement of the table that is causing this issue?
— Reply to this email directly or view it on GitHub https://github.com/Xethron/migrations-generator/issues/31#issuecomment-58016294 .
$table->boolean('deleted')->default(''); is set to null here but in table it is flase. Create script from pgadmin deleted boolean NOT NULL DEFAULT false, -- Active / Inactive
On Wed, Oct 8, 2014 at 1:51 PM, Rebin K Joseph rebinkjoseph@gmail.com wrote:
Schema::create('vessel', function(Blueprint $table) { $table->bigInteger('id', true); $table->string('vessel_name', 50); $table->string('imo', 15)->nullable(); $table->bigInteger('vessel_type_id'); $table->bigInteger('shipping_agent_id')->nullable(); $table->bigInteger('shipping_line_id')->nullable(); $table->bigInteger('flag_id'); $table->string('call_sign', 7); $table->string('mmsi', 9)->nullable(); $table->decimal('loa', 6, 3); $table->decimal('beam', 4)->nullable(); $table->decimal('air_draught', 4)->nullable(); $table->string('photo_url')->nullable(); $table->boolean('deleted')->default(''); $table->bigInteger('user_id'); $table->timestamps(); $table->char('profile_status')->default('B'); });
On Mon, Oct 6, 2014 at 6:57 PM, tomzx notifications@github.com wrote:
Hi @rebin https://github.com/rebin,
Could you provide the CREATE TABLE statement of the table that is causing this issue?
— Reply to this email directly or view it on GitHub https://github.com/Xethron/migrations-generator/issues/31#issuecomment-58016294 .
Hello again @rebin,
Sorry, I meant to ask for the SQL CREATE TABLE statement, not the php code.
CREATE TABLE `vessel` (
`id` int(10) unsigned not null auto_increment,
...
);
Ohh sorry, Here is the script. I use PostreSQL
CREATE TABLE vessel ( id bigint NOT NULL DEFAULT nextval('vessel_vessel_id_seq'::regclass), vessel_name character varying(50) NOT NULL, imo character varying(15), -- Every vessel will have a unique IMO number. The label begins with the letters "IMO" followed by either "Company" or "Registered Owner", then, followed by the seven digits. vessel_type_id bigint NOT NULL, -- vessel type master shipping_agent_id bigint, shipping_line_id bigint, flag_id bigint NOT NULL, -- countries master call_sign character varying(7) NOT NULL, mmsi character varying(9), loa numeric(6,3) NOT NULL, beam numeric(4,2), air_draught numeric(4,2), photo_url character varying(255), deleted boolean NOT NULL DEFAULT false, -- Active / Inactive user_id bigint NOT NULL, created_at timestamp(6) without time zone NOT NULL, updated_at timestamp(6) without time zone NOT NULL, profile_status character(1) NOT NULL DEFAULT 'B'::bpchar, -- Bacic or Completed. Use B for Basic anc C if profile saved completely CONSTRAINT vessel_pkey PRIMARY KEY (id) )
On Wed, Oct 8, 2014 at 6:06 PM, tomzx notifications@github.com wrote:
Hello again @rebin https://github.com/rebin,
Sorry, I meant to ask for the SQL CREATE TABLE statement, not the php code.
CREATE TABLE
vessel
(id
int(10) unsigned not null auto_increment, ... );— Reply to this email directly or view it on GitHub https://github.com/Xethron/migrations-generator/issues/31#issuecomment-58350502 .
Same issue I have with a postgres db
Seems to be related to #79 and #83
Fixed :)
I have a table with boolean field with default value set as false. When I run migration it shows $table->boolean('deleted')->default(''); default is shown as null field. Can you please check and let me know a solution for same