Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Fails: SQLSTATE[42804] #111

Open
srsgores opened this issue Aug 12, 2019 · 5 comments
Open

Installation Fails: SQLSTATE[42804] #111

srsgores opened this issue Aug 12, 2019 · 5 comments

Comments

@srsgores
Copy link

srsgores commented Aug 12, 2019

Similar to #68, I get SQLSTATE[42804] on installation:

"SQLSTATE[42804]: Datatype mismatch: 7 ERROR: column "send" cannot be cast automatically to type boolean HINT: You might need to specify "USING send::boolean". (SQL: ALTER TABLE indikator_news_posts ALTER send TYPE BOOLEAN)" on line 664 of /var/www/octobercms/vendor/laravel/framework/src/Illuminate/Database/Connection.php

Installing latest version via OctoberCMS, attempting to install 1.8.0, which fails. Using postgres

@srsgores
Copy link
Author

srsgores commented Feb 3, 2020

Am I missing something here? Please advise on installation. I still get this with the latest version

@elceka
Copy link
Contributor

elceka commented Mar 24, 2020

I have same issue on Postgres.

@tamtc84
Copy link

tamtc84 commented Jun 9, 2021

Similar to #68, I get SQLSTATE[42804] on installation:

"SQLSTATE[42804]: Datatype mismatch: 7 ERROR: column "send" cannot be cast automatically to type boolean HINT: You might need to specify "USING send::boolean". (SQL: ALTER TABLE indikator_news_posts ALTER send TYPE BOOLEAN)" on line 664 of /var/www/octobercms/vendor/laravel/framework/src/Illuminate/Database/Connection.php

Installing latest version via OctoberCMS, attempting to install 1.8.0, which fails. Using postgres

Because plugin can't create table in postgres with errors.
My postgres version is 9.5.
You can fix it in folder "/plugins/indikator/news/updates/", find some file begin with "create_" and change.
Or you can paste after code and run to create table.
`-- Sequence: public.news_categories_id_seq

-- DROP SEQUENCE public.news_categories_id_seq;

CREATE SEQUENCE public.news_categories_id_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE public.news_categories_id_seq
OWNER TO postgres;

-- Sequence: public.news_newsletter_logs_id_seq

-- DROP SEQUENCE public.news_newsletter_logs_id_seq;

CREATE SEQUENCE public.news_newsletter_logs_id_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE public.news_newsletter_logs_id_seq
OWNER TO postgres;


-- Table: public.news_categories

-- DROP TABLE public.news_categories;

CREATE TABLE public.news_categories
(
id integer NOT NULL DEFAULT nextval('news_categories_id_seq'::regclass),
name character varying(100) NOT NULL,
slug character varying(100) NOT NULL,
content text,
image character varying(191),
hidden character varying(1) NOT NULL DEFAULT '2'::character varying,
status character varying(1) NOT NULL DEFAULT '1'::character varying,
sort_order integer NOT NULL DEFAULT 1,
created_at timestamp(0) without time zone,
updated_at timestamp(0) without time zone,
CONSTRAINT news_categories_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.news_categories
OWNER TO postgres;

-- Index: public.news_categories_slug_index

-- DROP INDEX public.news_categories_slug_index;

CREATE INDEX news_categories_slug_index
ON public.news_categories
USING btree
(slug COLLATE pg_catalog."default");

-- Index: public.news_categories_sort_order_index

-- DROP INDEX public.news_categories_sort_order_index;

CREATE INDEX news_categories_sort_order_index
ON public.news_categories
USING btree
(sort_order);

--END-------------
-- Table: public.news_newsletter_logs

-- DROP TABLE public.news_newsletter_logs;

CREATE TABLE public.news_newsletter_logs
(
id integer NOT NULL DEFAULT nextval('news_newsletter_logs_id_seq'::regclass),
news_id integer,
subscriber_id integer,
queued_at timestamp(0) without time zone NOT NULL,
send_at timestamp(0) without time zone,
viewed_at timestamp(0) without time zone,
clicked_at timestamp(0) without time zone,
status character varying(191) NOT NULL,
job_id character varying(32),
hash character varying(191),
CONSTRAINT news_newsletter_logs_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.news_newsletter_logs
OWNER TO postgres;

-- Table: public.news_posts

-- DROP TABLE public.news_posts;

CREATE TABLE public.news_posts
(
id integer NOT NULL DEFAULT nextval('news_posts_id_seq'::regclass),
title character varying(100) NOT NULL,
slug character varying(100) NOT NULL,
introductory text,
content text,
published_at timestamp(0) without time zone,
status character varying(1) NOT NULL DEFAULT '1'::character varying,
statistics integer NOT NULL DEFAULT 0,
created_at timestamp(0) without time zone,
updated_at timestamp(0) without time zone,
image character varying(191),
featured smallint NOT NULL DEFAULT '2'::smallint,
last_send_at timestamp(0) without time zone,
category_id integer NOT NULL DEFAULT 1,
enable_newsletter_content boolean NOT NULL DEFAULT false,
newsletter_content text,
user_id integer,
tags text,
seo_title character varying(100),
seo_keywords character varying(100),
seo_desc character varying(191),
seo_image character varying(191),
CONSTRAINT news_posts_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.news_posts
OWNER TO postgres;

-- Index: public.news_posts_category_id_index

-- DROP INDEX public.news_posts_category_id_index;

CREATE INDEX news_posts_category_id_index
ON public.news_posts
USING btree
(category_id);

-- Index: public.news_posts_featured_index

-- DROP INDEX public.news_posts_featured_index;

CREATE INDEX news_posts_featured_index
ON public.news_posts
USING btree
(featured);

-- Index: public.news_posts_published_at_index

-- DROP INDEX public.news_posts_published_at_index;

CREATE INDEX news_posts_published_at_index
ON public.news_posts
USING btree
(published_at);

-- Index: public.news_posts_slug_index

-- DROP INDEX public.news_posts_slug_index;

CREATE INDEX news_posts_slug_index
ON public.news_posts
USING btree
(slug COLLATE pg_catalog."default");

-- Index: public.news_posts_user_id_index

-- DROP INDEX public.news_posts_user_id_index;

CREATE INDEX news_posts_user_id_index
ON public.news_posts
USING btree
(user_id);

-- Table: public.news_relations

-- DROP TABLE public.news_relations;

CREATE TABLE public.news_relations
(
subscriber_id integer NOT NULL,
categories_id integer NOT NULL,
CONSTRAINT news_relations_pkey PRIMARY KEY (subscriber_id, categories_id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.news_relations
OWNER TO postgres;


-- Table: public.news_subscribers

-- DROP TABLE public.news_subscribers;

CREATE TABLE public.news_subscribers
(
id integer NOT NULL DEFAULT nextval('news_subscribers_id_seq'::regclass),
name character varying(100) NOT NULL,
email character varying(100) NOT NULL,
comment text,
created character varying(1) NOT NULL DEFAULT '1'::character varying,
statistics integer NOT NULL DEFAULT 0,
created_at timestamp(0) without time zone,
updated_at timestamp(0) without time zone,
status character varying(1) NOT NULL DEFAULT '1'::character varying,
locale character varying(5),
registered_at timestamp(0) without time zone,
registered_ip character varying(191),
confirmed_at timestamp(0) without time zone,
confirmed_ip character varying(191),
confirmation_hash character varying(191),
unsubscribed_at timestamp(0) without time zone,
unsubscribed_ip character varying(191),
CONSTRAINT news_subscribers_pkey PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
ALTER TABLE public.news_subscribers
OWNER TO postgres;`

After create table, you open terminator or command from, goto folder octobercms
example:
cd D:\laragon\www\october

final, run code to refresh plugin :
php artisan plugin:refresh Indikator.News

Goto october, and test again.

@TimFoerster
Copy link
Contributor

@tamtc84 use code blocks please.

@tamtc84
Copy link

tamtc84 commented Jun 14, 2021

@tamtc84 use code blocks please.

Sorry TimFoerster. I used button "insert code" in editor but result is bad.
You can copy from:
-- Sequence: public.news_categories_id_seq
-- DROP SEQUENCE public.news_categories_id_seq;

to:
ALTER TABLE public.news_subscribers
OWNER TO postgres;

and paste to text script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants