Jaws was never my scene and I don't like Star Wars

DBIx::Class::Schema::Versioned errors

Quick post, since it might help someone - I couldn't find a complete solution on the intertubes...

DBIx::Class::Schema::Versioned makes use of SQL::Translator to generate DDL and diffs.

My own use-case calls for SQLite in some test/dev environments and PostgreSQL in staging/production, but I was unable to generate diffs for a recent change:

translate: Error with parser 'SQL::Translator::Parser::SQLite': Unable to parse line ...

Postgres has neat types like timestamp with time zone which you should think about using. SQLite, on the other hand, treats types a little differently.

No problem, you say, SQLite can simply ignore this type!

Fine in theory, but SQL::Translator::Parser::SQLite's grammar is a little tighter. The solution is to use the single-word definition for the desired type, 'timezonetz'.

Thanks to ilmari and others in #dbix-class for helping me get this straight!

by fuzzix on Wed, 08 Mar 2017 14:03.


Fri, 07 Feb 2020 15:56

It's `timestamptz`

Comment on this post

Text only, no HTML, * denotes a required field.

Name *
Email Address *
Mystery box, leave it alone!