Genie Discord forum

I'm learning the MVC example "Watch Tonight" at https://genieframework.com/docs/genie/v5.11/tutorials/Developing-MVC-Web-Apps.html, 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... ^

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.

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?

Thanks for your reply. I will try.

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

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

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 include
or with genie.loadapp()
https://genieframework.com/docs/genie/v5.11/API/genie.html#Genie.loadapp

Thanks! 🌹