Skip to content

Add migration styles#159

Merged
jessieay merged 1 commit intomasterfrom
jy-add-migration-styles
Apr 17, 2014
Merged

Add migration styles#159
jessieay merged 1 commit intomasterfrom
jy-add-migration-styles

Conversation

@jessieay
Copy link
Copy Markdown
Contributor

  • Default non-presence-validated string fields to empty string to avoid nil values
  • Put timestamps at the top when creating a table for consistency

Screenshot of db/schema with consistent use of timestamps at top:
screen shot 2014-04-16 at 2 30 38 pm

Screenshot of db/schema without consistent use of timestamps at top:

screen shot 2014-04-16 at 2 31 03 pm

Comment thread style/README.md Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Periods at the end of sentences.

Maybe "List timestamps first when creating a new table."

Link to an example migration?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done and done!

@croaky
Copy link
Copy Markdown
Contributor

croaky commented Apr 16, 2014

+1

@gylaz
Copy link
Copy Markdown
Contributor

gylaz commented Apr 16, 2014

It would be useful to add the default: '' example to the migrations file.

@richrines
Copy link
Copy Markdown

@gylaz I like the default: '' only on fields that are not null: false. That might just be personal preference.

@jessieay
Copy link
Copy Markdown
Contributor Author

@gylaz @richrines added a non-required field to the migration and added a default: '' to it :)

Comment thread style/README.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did these change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there was whitespace so I removed it and added it back to one line while I was at it. Are you going to make me take it back!? 😱

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You can just put it on one line. It fits under 80 characters.

* Default non-presence-validated string fields to empty string to avoid nil values
* Put timestamps at the top when creating a table for consistency
@jessieay
Copy link
Copy Markdown
Contributor Author

@jferris any input on this?

Comment thread style/README.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this say "default value?"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure but DEFAULT Constraint is a term. Maybe "Set an empty string as the default constraint value" would be more correct?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm, it seems like "default constraint" is actually the correct terminology here. Sort of confusing, because "default constraint" doesn't make much sense in English, but I'd say stick with the correct term according to SQL.

@jferris
Copy link
Copy Markdown
Contributor

jferris commented Apr 17, 2014

Looks good to me! I had one question on verbiage.

@jessieay jessieay merged commit 2344338 into master Apr 17, 2014
@jessieay jessieay deleted the jy-add-migration-styles branch April 17, 2014 17:45
gabebw added a commit that referenced this pull request Jan 15, 2015
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: #159
gabebw added a commit that referenced this pull request Mar 12, 2015
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: #159
Iej5dvl6uavySukn4c5icng added a commit to Iej5dvl6uavySukn4c5icng/guides that referenced this pull request Sep 29, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
AwxengelaPrij2g8n7eto added a commit to AwxengelaPrij2g8n7eto/guides that referenced this pull request Sep 29, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
Arthurq032pPxigarent added a commit to Arthurq032pPxigarent/guides that referenced this pull request Sep 29, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
Terdueik4nriePrater9zgdrbwv added a commit to Terdueik4nriePrater9zgdrbwv/guides that referenced this pull request Sep 30, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
Quin3dubywm2bktonElseq0agcbffhy added a commit to Quin3dubywm2bktonElseq0agcbffhy/guides that referenced this pull request Oct 2, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
Damiqnklg450ianVaiof92l added a commit to Damiqnklg450ianVaiof92l/guides that referenced this pull request Oct 2, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
amyriverazhuzhe19880317 added a commit to amyriverazhuzhe19880317/guides that referenced this pull request Oct 2, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
shi77203764583HollyMonroe added a commit to shi77203764583HollyMonroe/guides that referenced this pull request Oct 3, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
buosho5569 added a commit to buosho5569/guides that referenced this pull request Oct 3, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
kaowue8925 added a commit to kaowue8925/guides that referenced this pull request Oct 3, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
deborah2270-gillman2 added a commit to deborah2270-gillman2/guides that referenced this pull request Oct 3, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
yiye769895shaoRobertGarrett added a commit to yiye769895shaoRobertGarrett/guides that referenced this pull request Oct 3, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
fktkt66551404RobertAlexander added a commit to fktkt66551404RobertAlexander/guides that referenced this pull request Oct 8, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
michaeldavis5909michaeldavis added a commit to michaeldavis5909michaeldavis/guides that referenced this pull request Oct 8, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
cfkbfkBillyChavez added a commit to cfkbfkBillyChavez/guides that referenced this pull request Oct 8, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
lisalynncaishi11502873 added a commit to lisalynncaishi11502873/guides that referenced this pull request Oct 8, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
njpbtsvgcl319026 added a commit to njpbtsvgcl319026/guides that referenced this pull request Oct 8, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
meipinpupan03StacyHuynh added a commit to meipinpupan03StacyHuynh/guides that referenced this pull request Oct 8, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
MavisCouto79sy2887ElizabethMora added a commit to MavisCouto79sy2887ElizabethMora/guides that referenced this pull request Oct 10, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
duyqio3823576JamesPerez added a commit to duyqio3823576JamesPerez/guides that referenced this pull request Oct 10, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
dalecarrollnhdfyrati added a commit to dalecarrollnhdfyrati/guides that referenced this pull request Oct 10, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
RodneyReedzaizhongyou79692 added a commit to RodneyReedzaizhongyou79692/guides that referenced this pull request Oct 10, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
cmarvqrdsmafljpcn22063950AnnetteRamirez added a commit to cmarvqrdsmafljpcn22063950AnnetteRamirez/guides that referenced this pull request Oct 11, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
nfirbr45susanbanks added a commit to nfirbr45susanbanks/guides that referenced this pull request Oct 16, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
9W0RdaG4nickz8g added a commit to 9W0RdaG4nickz8g/guides that referenced this pull request Oct 16, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
cassarahlypqj4045joycejohnson added a commit to cassarahlypqj4045joycejohnson/guides that referenced this pull request Oct 16, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
obtzzw2343610 added a commit to obtzzw2343610/guides that referenced this pull request Oct 16, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
EricStephens1434TravisRogers added a commit to EricStephens1434TravisRogers/guides that referenced this pull request Oct 16, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
posi587294ronaldlindsey added a commit to posi587294ronaldlindsey/guides that referenced this pull request Oct 16, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
5contreras-jennal added a commit to 5contreras-jennal/guides that referenced this pull request Oct 19, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
aprilpdoregelj added a commit to aprilpdoregelj/guides that referenced this pull request Oct 19, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
dd6465-3 added a commit to dd6465-3/guides that referenced this pull request Oct 19, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
mmaxinequfrance added a commit to mmaxinequfrance/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
lm3549-r added a commit to lm3549-r/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
jcabezas-virginiax added a commit to jcabezas-virginiax/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
tb3461-0 added a commit to tb3461-0/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
mnewby-2255p added a commit to mnewby-2255p/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
aharvey8558-b added a commit to aharvey8558-b/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
virginia9869-rushingy added a commit to virginia9869-rushingy/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
jremillard7421-s added a commit to jremillard7421-s/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
p-thomasd added a commit to p-thomasd/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
gajasongilmore95 added a commit to gajasongilmore95/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
richard97-pa added a commit to richard97-pa/guides that referenced this pull request Oct 20, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
her2000-w9 added a commit to her2000-w9/guides that referenced this pull request Oct 26, 2025
`rails generate` puts timestamps at the bottom of a migration by default,
meaning we have to change every migration even if the migration is otherwise
generated perfectly.

Original discussion: thoughtbot/guides#159
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