Created
December 12, 2013 20:56
-
-
Save ehogberg/7935296 to your computer and use it in GitHub Desktop.
Proposed schema for company location model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE locations ( | |
id integer NOT NULL, | |
company_id integer, | |
name character varying(255), | |
legacy_url text, | |
address1 character varying(255), | |
address2 character varying(255), | |
city character varying(255), | |
region character varying(255), | |
country character varying(255), | |
postcode character varying(255), | |
telephone character varying(255), | |
manager_name character varying(255), | |
created_at timestamp without time zone, | |
updated_at timestamp without time zone | |
); |
I don't think timestamptz is desired as it does funny things depending on the local where you are querying/inserting from. See this link on how timezone conversion takes place.
See this excellent post on the differences.
http://stackoverflow.com/questions/9571392/ignoring-timezones-altogether-in-rails-and-postgresql
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see branch db-hygiene for some code relating to timestamps (should upgrade your schema to timezone columns
automagically)