mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-31 05:05:18 +01:00
Made changes to README_FOR_APP to point out that rake db_schema_import can be used instead of rake migrate with a new, blank database to set it up for use.
Fixes #210. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@186 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
dfe9389ece
commit
4800172bb4
3 changed files with 20 additions and 15 deletions
|
|
@ -22,6 +22,9 @@ class User < ActiveRecord::Base
|
|||
protected
|
||||
|
||||
def self.sha1(pass)
|
||||
# TODO find somewhere else to set the loginhash salt
|
||||
# This is hard-coded for now, but the user needs to be
|
||||
# able to set their own somewhere
|
||||
Digest::SHA1.hexdigest("change-me--#{pass}--")
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -5,26 +5,26 @@
|
|||
ActiveRecord::Schema.define(:version => 7) do
|
||||
|
||||
create_table "contexts", :force => true do |t|
|
||||
t.column "name", :string, :default => "", :null => false
|
||||
t.column "position", :integer, :default => 0, :null => false
|
||||
t.column "name", :string, :null => false
|
||||
t.column "position", :integer, :null => false
|
||||
t.column "hide", :boolean, :default => false
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :default => 1
|
||||
end
|
||||
|
||||
create_table "notes", :force => true do |t|
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "project_id", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :null => false
|
||||
t.column "project_id", :integer, :null => false
|
||||
t.column "body", :text
|
||||
t.column "created_at", :datetime
|
||||
t.column "updated_at", :datetime
|
||||
end
|
||||
|
||||
create_table "projects", :force => true do |t|
|
||||
t.column "name", :string, :default => "", :null => false
|
||||
t.column "position", :integer, :default => 0, :null => false
|
||||
t.column "name", :string, :null => false
|
||||
t.column "position", :integer, :null => false
|
||||
t.column "done", :boolean, :default => false
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "description", :text
|
||||
t.column "user_id", :integer, :default => 1
|
||||
t.column "description", :text, :default => ""
|
||||
end
|
||||
|
||||
create_table "sessions", :force => true do |t|
|
||||
|
|
@ -36,20 +36,20 @@ ActiveRecord::Schema.define(:version => 7) do
|
|||
add_index "sessions", ["session_id"], :name => "sessions_session_id_index"
|
||||
|
||||
create_table "todos", :force => true do |t|
|
||||
t.column "context_id", :integer, :default => 0, :null => false
|
||||
t.column "context_id", :integer, :null => false
|
||||
t.column "project_id", :integer
|
||||
t.column "description", :string, :default => "", :null => false
|
||||
t.column "description", :string, :null => false
|
||||
t.column "notes", :text
|
||||
t.column "done", :boolean, :default => false, :null => false
|
||||
t.column "created_at", :datetime
|
||||
t.column "due", :date
|
||||
t.column "completed", :datetime
|
||||
t.column "user_id", :integer, :default => 0, :null => false
|
||||
t.column "user_id", :integer, :default => 1
|
||||
end
|
||||
|
||||
create_table "users", :force => true do |t|
|
||||
t.column "login", :string, :limit => 80, :default => "", :null => false
|
||||
t.column "password", :string, :limit => 40, :default => "", :null => false
|
||||
t.column "login", :string, :limit => 80, :null => false
|
||||
t.column "password", :string, :limit => 40, :null => false
|
||||
t.column "word", :string
|
||||
t.column "is_admin", :boolean, :default => false, :null => false
|
||||
t.column "preferences", :text
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ In the following, I'm assuming that you're using MySQL and the built-in WEBrick
|
|||
|
||||
<tt>cd /PATHTO/TRACKS</tt>
|
||||
<tt>rake migrate</tt>
|
||||
|
||||
If you find that 'rake migrate' doesn't work for you, you can use the command <tt>rake db_schema_import</tt> which will do the same thing.
|
||||
|
||||
* Check the shebang lines of the public/dispatch.* files and all the files in the script directory. They are set to <tt>#!/usr/bin/env ruby</tt> by default. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
<tt>ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*</tt>
|
||||
|
|
@ -62,7 +64,7 @@ In the following, I'm assuming that you're using MySQL and the built-in WEBrick
|
|||
The instructions are the same as those for MySQL above, except that you don't need to create the database first before running 'rake migrate'. All you need to do is to give the file name of the database you'd like to create in database.yml. e.g.
|
||||
<tt>adapter: sqlite3</tt>
|
||||
<tt>database: /Users/YOURUSERNAME/Sites/tracks/db/tracks_104.db</tt>
|
||||
Then cd into the db directory and run rake migrate. This should create the database for you, and populate it with the correct tables.
|
||||
Then cd into the db directory and run rake migrate. This should create the database for you, and populate it with the correct tables. If you find that 'rake migrate' doesn't work for you, you can use the command <tt>rake db_schema_import</tt> which will do the same thing.
|
||||
|
||||
=== Upgrading from Tracks 1.03
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue