Skip to content

Update Event from and to fields for postgresql compatibility#25

Closed
jeremiahishere wants to merge 2 commits intorefinery:masterfrom
jeremiahishere:master
Closed

Update Event from and to fields for postgresql compatibility#25
jeremiahishere wants to merge 2 commits intorefinery:masterfrom
jeremiahishere:master

Conversation

@jeremiahishere
Copy link

The from and to fields were changed to start_at and end_at for postgresql
compatibility. The forms have been updated for the new fields. The
locales still call the fields "From" and "To" but are now referenced with
:start_at and :end_at.

The two fields were also changed from date to datetime fields.

I have not included an upgrade migration for either database change.

The from and to fields were changed to start_at and end_at for postgresql
compatibility.  The forms have been updated for the new fields.  The
locales still call the fields "From" and "To" but are now referenced with
:start_at and :end_at.

The two fields were also change from date to datetime fields.  I have
not included an upgrade migration for either database change.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you'll want t.datetime instead, no?

* Fixed data types on migration.
* Removed uniqueness constraint on Event.
* Fixed a bad ordering on Event.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this uniqueness constraint dropped? Inversely, why do events need unique titles?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using my fork of the project for a live site. This is one of the changes that got committed to the pull request branch by mistake. I need non unique titles because, for example, I have many events called 'Board Meeting' that are differentiated by their date instead of title.

@MarkBennett
Copy link

Any progress on this pull request? I'm experiencing a similar issue with Postgres compatibility. Without this change it is difficult to deploy properly to Heroku.

@jeremiahishere
Copy link
Author

My fork works as a temporary fix for postgres on heroku. You can regenerate the migrations or write one yourself that changes the from and to fields to start_at and end_at.

@sbeam
Copy link

sbeam commented Aug 23, 2012

FWIW SQLite is also unhappy with columns named 'from' and 'to' - this PR addresses that as well.

SQLite3::SQLException: near "from": syntax error: SELECT "refinery_calendar_events".* FROM "refinery_calendar_events"  WHERE (refinery_calendar_events.from >= '2012-08-23 13:59:00.718555') ORDER BY refinery_calendar_events.from DESC

@parndt
Copy link
Member

parndt commented Nov 22, 2012

Replaced by #28

@parndt parndt closed this Nov 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants