Genie Discord forum

Author AvatarJesse
4/1/2023, 6:25:45 AM

I'm learning the MVC example "Watch Tonight" at, trying to create table movies, and my database is Postgres, and I got the following error:

[ Info: SELECT version FROM schema_migrations ORDER BY version DESC WARNING: replacing module CreateTableMovies. [ Info: CREATE TABLE movies (id SERIAL PRIMARY KEY , type VARCHAR (10), title VARCHAR (100), directors VARCHAR (100), actors VARCHAR (250), country VARCHAR (100), year INTEGER (4), rating VARCHAR (10), categories VARCHAR (100), description VARCHAR (1000)) error | LibPQ: SyntaxError: error near "(" LINE 1: ...ARCHAR (250), country VARCHAR (100), year INTEGER (4), ratin... ^

Author AvatarPere
4/4/2023, 8:14:13 AM

I haven't tried with Postgres, but I believe this error happens because Postgres doesn't accept length parameters for integers. It should be year INTEGER without the (4).

This is something that needs to be fixed in the SearchLight code, will open an issue about it.

Author AvatarPere
4/4/2023, 8:16:42 AM

I don't have a Postgres setup so I cannot test this, is there any way you could run the query without the (4) argument and see if it works?

Author AvatarJesse
4/4/2023, 9:56:35 AM

Thanks for your reply. I will try.

Author AvatarJesse
4/8/2023, 9:44:30 AM

the sql works "year INTEGER without the (4)".

Author AvatarJesse
4/8/2023, 9:47:55 AM

BTW, in the same tutorial, using WatchTonight, missing reference WatchTonight. Why is that?

Author AvatarPere
4/11/2023, 8:30:02 AM

I think that removing the limit = 4 keyword argument in the _create_table_movies.jl migration file will fix the issue with Postgres.

As for the missing reference error, you need to load the Movies module after creating it. you can do try with includeor with genie.loadapp()