Skip to content

Conversation

@zzet
Copy link
Contributor

@zzet zzet commented Oct 3, 2012

Added support postresql database from box installation without error and updated installation doc

@NARKOZ
Copy link
Contributor

NARKOZ commented Oct 8, 2012

Looks like a hack. What about schema.rb? Do tests pass?

NARKOZ and others added 12 commits October 8, 2012 16:59
* support/postgres_db: (34 commits)
  add sqlite to tests
  test postgres
  Fix dashboard atom feed routes
  Do not allow removal of a project owner user.
  API: add project snippets listing
  projects API should return info about deleted hook
  add API changelog
  Doc fix: Nginx init script requires sudo
  Tiny fix to the add/edit groups form path field
  reversed order of progress indication for visual harmony so that text matches the progress bar
  move emoji module to lib
  no need to add fonts to assets path
  improve emoji checking performance
  specify HTTP verbs for match in routes
  Fix tests
  Remove leftover ref_extractor_spec file
  Revert "Use official Grit 2.5.0"
  ExtractsPath: Use ref_names instead of branches+tags
  Fix bug with branches whose name contains slash
  added trace to travis
  ...
@zzet
Copy link
Contributor Author

zzet commented Oct 8, 2012

Looks like a hack.

thx

What about schema.rb?

added. What about autoupdate db/schema with run rake db:migrate?

Do tests pass?

yes. With fix models. Code attached.

p.s. updated to upstream.
p.p.s. Do you really support sqllite? Look at the test...

@zzet zzet closed this Oct 8, 2012
@vsizov
Copy link
Contributor

vsizov commented Oct 8, 2012

What about autoupdate db/schema with run rake db:migrate?

when you run db:setup then schema.rb will be used.

@zzet
Copy link
Contributor Author

zzet commented Oct 8, 2012

Ok. Code updated.

But after run rake task this hack will be overwritten…

May be not use rake db:setup?

rake db:setup # Create the database, load the schema, and initialize with the seed data (use db:reset to also drop the db first)

We can create db, run migration and load seed data… This would be equivalent, but it will not be necessary to remember about the hack ...

С наилучшими пожеланиями, Андрей Куманяев.
-=-=-=-
тел. : +7 (8422) 43-01-51 (c 20:00 до 24:00 + автоответчик)
тел. : +7 (8422) 27-09-83 (c 20:00 до 24:00)
моб. : +7 (9510) 99-93-93 (с 09:00 до 21:00 пн-пт)
web : http://zzet.org
icq : 635529
email : me@zzet.org
skype : zzetik
-=-=-=-

On Tuesday, 9 October 2012 г. at 0:47, Valeriy Sizov wrote:

What about autoupdate db/schema with run rake db:migrate?
when you run db:setup then schema.rb will be used.


Reply to this email directly or view it on GitHub (#1623 (comment)).

@dzaporozhets
Copy link
Contributor

migrations is not an options. DB should be build from schema for new instances.

@zzet
Copy link
Contributor Author

zzet commented Oct 9, 2012

migrations is not an options. DB should be build from schema for new instances.

It is quite possible, especially if used in the migration models that have been removed or rewritten so much that the fall migration to fail. But you do not have the practice of zero migration? not always possible to use the scheme because schema.rb not affect things that are not described in the DSL. such as triggers. this way means that it is often necessary to move away from the side rb to sql schema (migration). it is changing the config.

You'll want to use rake db:migrate any time you have generated a new rails migration and want to have those changes applied. So, any time you modify your database, you'll run rake db:migrate.

Rake db:setup is used only when you are setting up a new db on your app. Rake db:setup is actually a shortcut for running rake db:create; rake db:schema:load, and rake db:seed.

If we have to work correctly migration or zero migration - the launch rake db:create && rake db:migrate && rake db:seed will not only bring the same result, but it could be better.

@dzaporozhets
Copy link
Contributor

  1. No real reason to use database triggers in GitLab
  2. schema.rb is more readable than sql
  3. building db from migrations slower than from schema.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

10 participants