Open jacobvosmaer opened 9 years ago
Note that there are more differences than just those visible in schema.rb
when you compare the outputs of \d snippets
on original PG (snippets.table.psql
) and converted PG (snippets.table.mysql
):
diff --git a/Users/douwemaan/Desktop/snippets.table.psql b/Users/douwemaan/Desktop/snippets.table.mysql
index 0ca7fd6..8d77d01 100644
--- a/Users/douwemaan/Desktop/snippets.table.psql
+++ b/Users/douwemaan/Desktop/snippets.table.mysql
@@ -2,15 +2,15 @@
Column | Type | Modifiers
------------------+-----------------------------+-------------------------------------------------------
id | integer | not null default nextval('snippets_id_seq'::regclass)
- title | character varying(255) |
+ title | character varying(510) | default NULL::character varying
content | text |
author_id | integer | not null
project_id | integer |
- created_at | timestamp without time zone |
- updated_at | timestamp without time zone |
- file_name | character varying(255) |
- expires_at | timestamp without time zone |
- type | character varying(255) |
+ created_at | timestamp with time zone |
+ updated_at | timestamp with time zone |
+ file_name | character varying(510) | default NULL::character varying
+ expires_at | timestamp with time zone |
+ type | character varying(510) | default NULL::character varying
visibility_level | integer | not null default 0
Indexes:
"snippets_pkey" PRIMARY KEY, btree (id)
Ughh... @DouweM could you create separate issues for the differences?
I think it would be really nice to stamp these out.
mysql-postgresql-converter converts varchar(255)
to character varying (510)
on purpose, and I'm assuming it converts datetime
to timestamp with time zone
just to be on the safe side.
Oddly, the content
type is set to text
in both, but for some reason it ends up with limit: 2147483647
in the converted schema.rb. I don't see that in the table definition.
@jacobvosmaer Yes, will do.
@DouweM the converter does all sorts of things on purpose; it is just that those things were put there by the lanyrd developers, not by us. :)
@jacobvosmaer Yep. Unfortunately the reasoning behind these choices is completely undocumented. :(
After passing through the converter, you get a PG database with 'limits' in some places.
We should not have the limits. cc @DouweM @dosire