jberger / Galileo

A Simple Modern Perl CMS

Home Page:http://galileo-cms.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'VARCHAR' is invalid SQL-Syntax

wollmers opened this issue · comments

Got an SQL syntax error during setup using MySQL.

VARCHAR needs a length parameter like VARCHAR(80) in most DB-Systems (except SQLite).

VARCHAR(n) should work in SQLite, MySQL, PostgreSQL, Oracle, MS SQL, Sybase, TERADATA, DB2, INFORMIX, and INGRES.

So you should change all definitions in DB::Schema::Result.

Also keep in mind that VARCHAR has a small maximum on some DB-Systems (e.g. 4000 in Oracle), not large enough to store the content of the columns 'html' and 'md' in the table 'page' in some cases.

Databases are by far the weakest part of my programming skills, that's part of why I got excited about the prospect of working with a database abstraction engine. There are several outstanding issues with the database, mostly in the schema, but now I suppose with the types too. I was hoping to introduce versioned schemas too for upgrading. Sounds like I will have an incompatible release coming soon.

Thanks for the report, I will leave this open while I work on it.

Ok, I think I've gotten this one (at least it works for me on MySQL 5.1). I do wonder if I should use a longer TEXT, like MEDIUMTEXT. I still need to do versioning for the schema and probably a few extra fields before an incompatible release.