From 46450cebeffbfa7623eb8c225ed1922ad375b58a Mon Sep 17 00:00:00 2001 From: benni Date: Sat, 7 May 2011 21:55:24 +0200 Subject: [PATCH] New annotation, because of db switch to mysql. Background: sqlite has some problems with decimal option. --- app/models/article_category.rb | 19 ++++---- app/models/article_price.rb | 27 +++++------ app/models/assignment.rb | 9 ++-- app/models/delivery.rb | 5 ++- app/models/financial_transaction.rb | 25 ++++++----- app/models/group.rb | 23 +++++----- app/models/group_order.rb | 27 +++++------ app/models/group_order_article.rb | 11 ++--- app/models/group_order_article_quantity.rb | 23 +++++----- app/models/invite.rb | 25 ++++++----- app/models/invoice.rb | 9 ++-- app/models/membership.rb | 19 ++++---- app/models/message.rb | 9 ++-- app/models/order.rb | 31 ++++++------- app/models/order_article.rb | 29 ++++++------ app/models/order_comment.rb | 23 +++++----- app/models/ordergroup.rb | 22 ++++----- app/models/page.rb | 10 ++--- app/models/stock_article.rb | 12 ++--- app/models/stock_change.rb | 27 +++++------ app/models/stock_taking.rb | 21 ++++----- app/models/supplier.rb | 45 ++++++++++--------- app/models/task.rb | 14 +++--- app/models/user.rb | 37 +++++++-------- app/models/workgroup.rb | 22 ++++----- db/schema.rb | 24 +++++----- test/fixtures/article_categories.yml | 19 ++++---- test/fixtures/article_prices.yml | 27 +++++------ test/fixtures/articles.yml | 1 + test/fixtures/assignments.yml | 9 ++-- test/fixtures/financial_transactions.yml | 25 ++++++----- .../group_order_article_quantities.yml | 13 +++--- test/fixtures/groups.yml | 23 +++++----- test/fixtures/memberships.yml | 19 ++++---- test/fixtures/messages.yml | 9 ++-- test/fixtures/order_comments.yml | 9 ++-- test/fixtures/orders.yml | 11 ++--- test/fixtures/pages.yml | 11 ++--- test/fixtures/stock_changes.yml | 15 ++++--- test/fixtures/stock_takings.yml | 7 +-- test/fixtures/suppliers.yml | 2 + test/fixtures/tasks.yml | 15 ++++--- test/fixtures/users.yml | 37 +++++++-------- test/unit/article_category_test.rb | 19 ++++---- test/unit/article_price_test.rb | 27 +++++------ test/unit/assignment_test.rb | 9 ++-- test/unit/financial_transaction_test.rb | 25 ++++++----- .../unit/group_order_article_quantity_test.rb | 23 +++++----- test/unit/group_test.rb | 23 +++++----- test/unit/membership_test.rb | 19 ++++---- test/unit/order_comment_test.rb | 23 +++++----- test/unit/order_test.rb | 31 ++++++------- test/unit/page_test.rb | 11 ++--- test/unit/stock_article_test.rb | 13 +++--- test/unit/stock_change_test.rb | 27 +++++------ test/unit/stock_taking_test.rb | 21 ++++----- test/unit/supplier_test.rb | 45 ++++++++++--------- test/unit/task_test.rb | 15 ++++--- test/unit/user_test.rb | 37 +++++++-------- test/unit/workgroup_test.rb | 23 +++++----- 60 files changed, 623 insertions(+), 568 deletions(-) diff --git a/app/models/article_category.rb b/app/models/article_category.rb index 0fef9c4d..2fc39aaf 100644 --- a/app/models/article_category.rb +++ b/app/models/article_category.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: article_categories -# -# id :integer not null, primary key -# name :string(255) default(""), not null -# description :string(255) -# - class ArticleCategory < ActiveRecord::Base has_many :articles @@ -14,3 +5,13 @@ class ArticleCategory < ActiveRecord::Base validates_uniqueness_of :name end + +# == Schema Information +# +# Table name: article_categories +# +# id :integer(4) not null, primary key +# name :string(255) default(""), not null +# description :string(255) +# + diff --git a/app/models/article_price.rb b/app/models/article_price.rb index 437fdbc1..316c3925 100644 --- a/app/models/article_price.rb +++ b/app/models/article_price.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: article_prices -# -# id :integer not null, primary key -# article_id :integer -# price :decimal(8, 2) default(0.0), not null -# tax :decimal(8, 2) default(0.0), not null -# deposit :decimal(8, 2) default(0.0), not null -# unit_quantity :integer -# created_at :datetime -# - class ArticlePrice < ActiveRecord::Base belongs_to :article @@ -43,3 +30,17 @@ class ArticlePrice < ActiveRecord::Base (gross_price * (Foodsoft.config[:price_markup] / 100 + 1)).round(2) end end + +# == Schema Information +# +# Table name: article_prices +# +# id :integer(4) not null, primary key +# article_id :integer(4) +# price :decimal(8, 2) default(0.0), not null +# tax :decimal(8, 2) default(0.0), not null +# deposit :decimal(8, 2) default(0.0), not null +# unit_quantity :integer(4) +# created_at :datetime +# + diff --git a/app/models/assignment.rb b/app/models/assignment.rb index 5c6ebea1..6408b9e8 100644 --- a/app/models/assignment.rb +++ b/app/models/assignment.rb @@ -14,13 +14,14 @@ class Assignment < ActiveRecord::Base end end + # == Schema Information # # Table name: assignments # -# id :integer not null, primary key -# user_id :integer default(0), not null -# task_id :integer default(0), not null -# accepted :boolean default(FALSE) +# id :integer(4) not null, primary key +# user_id :integer(4) default(0), not null +# task_id :integer(4) default(0), not null +# accepted :boolean(1) default(FALSE) # diff --git a/app/models/delivery.rb b/app/models/delivery.rb index fcfd152b..da0a0d8d 100644 --- a/app/models/delivery.rb +++ b/app/models/delivery.rb @@ -18,12 +18,13 @@ class Delivery < ActiveRecord::Base end + # == Schema Information # # Table name: deliveries # -# id :integer not null, primary key -# supplier_id :integer +# id :integer(4) not null, primary key +# supplier_id :integer(4) # delivered_on :date # created_at :datetime # note :text diff --git a/app/models/financial_transaction.rb b/app/models/financial_transaction.rb index 92d908f3..c1b8165d 100644 --- a/app/models/financial_transaction.rb +++ b/app/models/financial_transaction.rb @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: financial_transactions -# -# id :integer not null, primary key -# ordergroup_id :integer default(0), not null -# amount :decimal(8, 2) default(0.0), not null -# note :text not null -# user_id :integer default(0), not null -# created_on :datetime not null -# - # financial transactions are the foodcoop internal financial transactions # only ordergroups have an account balance and are happy to transfer money class FinancialTransaction < ActiveRecord::Base @@ -25,3 +13,16 @@ class FinancialTransaction < ActiveRecord::Base end end + +# == Schema Information +# +# Table name: financial_transactions +# +# id :integer(4) not null, primary key +# ordergroup_id :integer(4) default(0), not null +# amount :decimal(8, 2) default(0.0), not null +# note :text default(""), not null +# user_id :integer(4) default(0), not null +# created_on :datetime not null +# + diff --git a/app/models/group.rb b/app/models/group.rb index 1e11d75d..36953268 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -41,32 +41,33 @@ class Group < ActiveRecord::Base end + # == Schema Information # # Table name: groups # -# id :integer not null, primary key +# id :integer(4) not null, primary key # type :string(255) default(""), not null # name :string(255) default(""), not null # description :string(255) -# account_balance :decimal(, ) default(0.0), not null +# account_balance :decimal(8, 2) default(0.0), not null # account_updated :datetime # created_on :datetime not null -# role_admin :boolean default(FALSE), not null -# role_suppliers :boolean default(FALSE), not null -# role_article_meta :boolean default(FALSE), not null -# role_finance :boolean default(FALSE), not null -# role_orders :boolean default(FALSE), not null -# weekly_task :boolean default(FALSE) -# weekday :integer +# role_admin :boolean(1) default(FALSE), not null +# role_suppliers :boolean(1) default(FALSE), not null +# role_article_meta :boolean(1) default(FALSE), not null +# role_finance :boolean(1) default(FALSE), not null +# role_orders :boolean(1) default(FALSE), not null +# weekly_task :boolean(1) default(FALSE) +# weekday :integer(4) # task_name :string(255) # task_description :string(255) -# task_required_users :integer default(1) +# task_required_users :integer(4) default(1) # deleted_at :datetime # contact_person :string(255) # contact_phone :string(255) # contact_address :string(255) # stats :text -# task_duration :integer default(1) +# task_duration :integer(4) default(1) # diff --git a/app/models/group_order.rb b/app/models/group_order.rb index d939d81c..9a0a7ad6 100644 --- a/app/models/group_order.rb +++ b/app/models/group_order.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: group_orders -# -# id :integer not null, primary key -# ordergroup_id :integer default(0), not null -# order_id :integer default(0), not null -# price :decimal(8, 2) default(0.0), not null -# lock_version :integer default(0), not null -# updated_on :datetime not null -# updated_by_user_id :integer -# - # A GroupOrder represents an Order placed by an Ordergroup. class GroupOrder < ActiveRecord::Base @@ -49,3 +36,17 @@ class GroupOrder < ActiveRecord::Base end end + +# == Schema Information +# +# Table name: group_orders +# +# id :integer(4) not null, primary key +# ordergroup_id :integer(4) default(0), not null +# order_id :integer(4) default(0), not null +# price :decimal(8, 2) default(0.0), not null +# lock_version :integer(4) default(0), not null +# updated_on :datetime not null +# updated_by_user_id :integer(4) +# + diff --git a/app/models/group_order_article.rb b/app/models/group_order_article.rb index 15ee0aaa..9612917e 100644 --- a/app/models/group_order_article.rb +++ b/app/models/group_order_article.rb @@ -159,15 +159,16 @@ class GroupOrderArticle < ActiveRecord::Base end + # == Schema Information # # Table name: group_order_articles # -# id :integer not null, primary key -# group_order_id :integer default(0), not null -# order_article_id :integer default(0), not null -# quantity :integer default(0), not null -# tolerance :integer default(0), not null +# id :integer(4) not null, primary key +# group_order_id :integer(4) default(0), not null +# order_article_id :integer(4) default(0), not null +# quantity :integer(4) default(0), not null +# tolerance :integer(4) default(0), not null # updated_on :datetime not null # result :decimal(8, 3) # diff --git a/app/models/group_order_article_quantity.rb b/app/models/group_order_article_quantity.rb index 869adc0d..5d31fefe 100644 --- a/app/models/group_order_article_quantity.rb +++ b/app/models/group_order_article_quantity.rb @@ -1,14 +1,3 @@ -# == Schema Information -# -# Table name: group_order_article_quantities -# -# id :integer not null, primary key -# group_order_article_id :integer default(0), not null -# quantity :integer default(0) -# tolerance :integer default(0) -# created_on :datetime not null -# - # stores the quantity, tolerance and timestamp of an GroupOrderArticle # Considers every update of an article-order, so may rows for one group_order_article ar possible. @@ -21,3 +10,15 @@ class GroupOrderArticleQuantity < ActiveRecord::Base validates_inclusion_of :tolerance, :in => 0..99 end + +# == Schema Information +# +# Table name: group_order_article_quantities +# +# id :integer(4) not null, primary key +# group_order_article_id :integer(4) default(0), not null +# quantity :integer(4) default(0) +# tolerance :integer(4) default(0) +# created_on :datetime not null +# + diff --git a/app/models/invite.rb b/app/models/invite.rb index 88a71bde..d8eed384 100644 --- a/app/models/invite.rb +++ b/app/models/invite.rb @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: invites -# -# id :integer not null, primary key -# token :string(255) default(""), not null -# expires_at :datetime not null -# group_id :integer default(0), not null -# user_id :integer default(0), not null -# email :string(255) default(""), not null -# - require 'digest/sha1' # Invites are created by foodcoop users to invite a new user into the foodcoop and their order group. @@ -46,3 +34,16 @@ class Invite < ActiveRecord::Base end end + +# == Schema Information +# +# Table name: invites +# +# id :integer(4) not null, primary key +# token :string(255) default(""), not null +# expires_at :datetime not null +# group_id :integer(4) default(0), not null +# user_id :integer(4) default(0), not null +# email :string(255) default(""), not null +# + diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 3fd5ed88..b65305e5 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -29,14 +29,15 @@ class Invoice < ActiveRecord::Base end end + # == Schema Information # # Table name: invoices # -# id :integer not null, primary key -# supplier_id :integer -# delivery_id :integer -# order_id :integer +# id :integer(4) not null, primary key +# supplier_id :integer(4) +# delivery_id :integer(4) +# order_id :integer(4) # number :string(255) # date :date # paid_on :date diff --git a/app/models/membership.rb b/app/models/membership.rb index c0cf679e..d448ffe3 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: memberships -# -# id :integer not null, primary key -# group_id :integer default(0), not null -# user_id :integer default(0), not null -# - class Membership < ActiveRecord::Base belongs_to :user @@ -20,3 +11,13 @@ class Membership < ActiveRecord::Base raise ERR_NO_ADMIN_MEMBER_DELETE if self.group.role_admin? && self.group.memberships.size == 1 && Group.find_all_by_role_admin(true).size == 1 end end + +# == Schema Information +# +# Table name: memberships +# +# id :integer(4) not null, primary key +# group_id :integer(4) default(0), not null +# user_id :integer(4) default(0), not null +# + diff --git a/app/models/message.rb b/app/models/message.rb index 8e09710e..7b470293 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -76,17 +76,18 @@ class Message < ActiveRecord::Base end end + # == Schema Information # # Table name: messages # -# id :integer not null, primary key -# sender_id :integer +# id :integer(4) not null, primary key +# sender_id :integer(4) # recipients_ids :text # subject :string(255) not null # body :text -# email_state :integer default(0), not null -# private :boolean default(FALSE) +# email_state :integer(4) default(0), not null +# private :boolean(1) default(FALSE) # created_at :datetime # diff --git a/app/models/order.rb b/app/models/order.rb index f3f2f9d9..f154501f 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -1,18 +1,3 @@ -# == Schema Information -# -# Table name: orders -# -# id :integer not null, primary key -# supplier_id :integer -# note :text -# starts :datetime -# ends :datetime -# state :string(255) default("open") -# lock_version :integer default(0), not null -# updated_by_user_id :integer -# foodcoop_result :decimal(8, 2) -# - class Order < ActiveRecord::Base extend ActiveSupport::Memoizable # Ability to cache method results. Use memoize :expensive_method acts_as_ordered :order => "ends" # easyier find of next or previous model @@ -226,3 +211,19 @@ class Order < ActiveRecord::Base end end + +# == Schema Information +# +# Table name: orders +# +# id :integer(4) not null, primary key +# supplier_id :integer(4) +# note :text +# starts :datetime +# ends :datetime +# state :string(255) default("open") +# lock_version :integer(4) default(0), not null +# updated_by_user_id :integer(4) +# foodcoop_result :decimal(8, 2) +# + diff --git a/app/models/order_article.rb b/app/models/order_article.rb index cc0f9ccc..1c32b2c0 100644 --- a/app/models/order_article.rb +++ b/app/models/order_article.rb @@ -1,17 +1,3 @@ -# == Schema Information -# -# Table name: order_articles -# -# id :integer not null, primary key -# order_id :integer default(0), not null -# article_id :integer default(0), not null -# quantity :integer default(0), not null -# tolerance :integer default(0), not null -# units_to_order :integer default(0), not null -# lock_version :integer default(0), not null -# article_price_id :integer -# - # An OrderArticle represents a single Article that is part of an Order. class OrderArticle < ActiveRecord::Base @@ -120,3 +106,18 @@ class OrderArticle < ActiveRecord::Base end end + +# == Schema Information +# +# Table name: order_articles +# +# id :integer(4) not null, primary key +# order_id :integer(4) default(0), not null +# article_id :integer(4) default(0), not null +# quantity :integer(4) default(0), not null +# tolerance :integer(4) default(0), not null +# units_to_order :integer(4) default(0), not null +# lock_version :integer(4) default(0), not null +# article_price_id :integer(4) +# + diff --git a/app/models/order_comment.rb b/app/models/order_comment.rb index d03c3d45..98126d74 100644 --- a/app/models/order_comment.rb +++ b/app/models/order_comment.rb @@ -1,14 +1,3 @@ -# == Schema Information -# -# Table name: order_comments -# -# id :integer not null, primary key -# order_id :integer -# user_id :integer -# text :text -# created_at :datetime -# - class OrderComment < ActiveRecord::Base belongs_to :order @@ -16,3 +5,15 @@ class OrderComment < ActiveRecord::Base validates_presence_of :order_id, :user_id, :text end + +# == Schema Information +# +# Table name: order_comments +# +# id :integer(4) not null, primary key +# order_id :integer(4) +# user_id :integer(4) +# text :text +# created_at :datetime +# + diff --git a/app/models/ordergroup.rb b/app/models/ordergroup.rb index b7dda88f..7eef09ad 100644 --- a/app/models/ordergroup.rb +++ b/app/models/ordergroup.rb @@ -87,28 +87,28 @@ end # # Table name: groups # -# id :integer not null, primary key +# id :integer(4) not null, primary key # type :string(255) default(""), not null # name :string(255) default(""), not null # description :string(255) -# account_balance :decimal(, ) default(0.0), not null +# account_balance :decimal(8, 2) default(0.0), not null # account_updated :datetime # created_on :datetime not null -# role_admin :boolean default(FALSE), not null -# role_suppliers :boolean default(FALSE), not null -# role_article_meta :boolean default(FALSE), not null -# role_finance :boolean default(FALSE), not null -# role_orders :boolean default(FALSE), not null -# weekly_task :boolean default(FALSE) -# weekday :integer +# role_admin :boolean(1) default(FALSE), not null +# role_suppliers :boolean(1) default(FALSE), not null +# role_article_meta :boolean(1) default(FALSE), not null +# role_finance :boolean(1) default(FALSE), not null +# role_orders :boolean(1) default(FALSE), not null +# weekly_task :boolean(1) default(FALSE) +# weekday :integer(4) # task_name :string(255) # task_description :string(255) -# task_required_users :integer default(1) +# task_required_users :integer(4) default(1) # deleted_at :datetime # contact_person :string(255) # contact_phone :string(255) # contact_address :string(255) # stats :text -# task_duration :integer default(1) +# task_duration :integer(4) default(1) # diff --git a/app/models/page.rb b/app/models/page.rb index bc04b1d6..65b55e28 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -56,14 +56,14 @@ end # # Table name: pages # -# id :integer not null, primary key +# id :integer(4) not null, primary key # title :string(255) # body :text # permalink :string(255) -# lock_version :integer default(0) -# updated_by :integer -# redirect :integer -# parent_id :integer +# lock_version :integer(4) default(0) +# updated_by :integer(4) +# redirect :integer(4) +# parent_id :integer(4) # created_at :datetime # updated_at :datetime # diff --git a/app/models/stock_article.rb b/app/models/stock_article.rb index f14e6918..7e2924c0 100644 --- a/app/models/stock_article.rb +++ b/app/models/stock_article.rb @@ -42,25 +42,25 @@ end # # Table name: articles # -# id :integer not null, primary key +# id :integer(4) not null, primary key # name :string(255) default(""), not null -# supplier_id :integer default(0), not null -# article_category_id :integer default(0), not null +# supplier_id :integer(4) default(0), not null +# article_category_id :integer(4) default(0), not null # unit :string(255) default(""), not null # note :string(255) -# availability :boolean default(TRUE), not null +# availability :boolean(1) default(TRUE), not null # manufacturer :string(255) # origin :string(255) # shared_updated_on :datetime # price :decimal(8, 2) # tax :float # deposit :decimal(8, 2) default(0.0) -# unit_quantity :integer default(1), not null +# unit_quantity :integer(4) default(1), not null # order_number :string(255) # created_at :datetime # updated_at :datetime # deleted_at :datetime # type :string(255) -# quantity :integer default(0) +# quantity :integer(4) default(0) # diff --git a/app/models/stock_change.rb b/app/models/stock_change.rb index 94ac0938..7797dc11 100644 --- a/app/models/stock_change.rb +++ b/app/models/stock_change.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: stock_changes -# -# id :integer not null, primary key -# delivery_id :integer -# order_id :integer -# stock_article_id :integer -# quantity :integer default(0) -# created_at :datetime -# stock_taking_id :integer -# - class StockChange < ActiveRecord::Base belongs_to :delivery belongs_to :order @@ -28,3 +15,17 @@ class StockChange < ActiveRecord::Base stock_article.update_quantity! end end + +# == Schema Information +# +# Table name: stock_changes +# +# id :integer(4) not null, primary key +# delivery_id :integer(4) +# order_id :integer(4) +# stock_article_id :integer(4) +# quantity :integer(4) default(0) +# created_at :datetime +# stock_taking_id :integer(4) +# + diff --git a/app/models/stock_taking.rb b/app/models/stock_taking.rb index 0b3234b1..a5c6b335 100644 --- a/app/models/stock_taking.rb +++ b/app/models/stock_taking.rb @@ -1,13 +1,3 @@ -# == Schema Information -# -# Table name: stock_takings -# -# id :integer not null, primary key -# date :date -# note :text -# created_at :datetime -# - class StockTaking < ActiveRecord::Base has_many :stock_changes, :dependent => :destroy @@ -21,3 +11,14 @@ class StockTaking < ActiveRecord::Base end end end + +# == Schema Information +# +# Table name: stock_takings +# +# id :integer(4) not null, primary key +# date :date +# note :text +# created_at :datetime +# + diff --git a/app/models/supplier.rb b/app/models/supplier.rb index abe53364..b1768bfe 100644 --- a/app/models/supplier.rb +++ b/app/models/supplier.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: suppliers -# -# id :integer not null, primary key -# name :string(255) default(""), not null -# address :string(255) default(""), not null -# phone :string(255) default(""), not null -# phone2 :string(255) -# fax :string(255) -# email :string(255) -# url :string(255) -# contact_person :string(255) -# customer_number :string(255) -# delivery_days :string(255) -# order_howto :string(255) -# note :string(255) -# shared_supplier_id :integer -# min_order_quantity :string(255) -# deleted_at :datetime -# - class Supplier < ActiveRecord::Base acts_as_paranoid # Avoid deleting the supplier for consistency of order-results @@ -84,3 +62,26 @@ class Supplier < ActiveRecord::Base return [updated_articles, outlisted_articles] end end + +# == Schema Information +# +# Table name: suppliers +# +# id :integer(4) not null, primary key +# name :string(255) default(""), not null +# address :string(255) default(""), not null +# phone :string(255) default(""), not null +# phone2 :string(255) +# fax :string(255) +# email :string(255) +# url :string(255) +# contact_person :string(255) +# customer_number :string(255) +# delivery_days :string(255) +# order_howto :string(255) +# note :string(255) +# shared_supplier_id :integer(4) +# min_order_quantity :string(255) +# deleted_at :datetime +# + diff --git a/app/models/task.rb b/app/models/task.rb index 39477c2b..5b2c91c9 100644 --- a/app/models/task.rb +++ b/app/models/task.rb @@ -77,17 +77,17 @@ end # # Table name: tasks # -# id :integer not null, primary key +# id :integer(4) not null, primary key # name :string(255) default(""), not null # description :string(255) # due_date :date -# done :boolean default(FALSE) -# workgroup_id :integer -# assigned :boolean default(FALSE) +# done :boolean(1) default(FALSE) +# workgroup_id :integer(4) +# assigned :boolean(1) default(FALSE) # created_on :datetime not null # updated_on :datetime not null -# required_users :integer default(1) -# weekly :boolean -# duration :integer default(1) +# required_users :integer(4) default(1) +# weekly :boolean(1) +# duration :integer(4) default(1) # diff --git a/app/models/user.rb b/app/models/user.rb index ffed3549..81b80e9f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,21 +1,3 @@ -# == Schema Information -# -# Table name: users -# -# id :integer not null, primary key -# nick :string(255) default(""), not null -# password_hash :string(255) default(""), not null -# password_salt :string(255) default(""), not null -# first_name :string(255) default(""), not null -# last_name :string(255) default(""), not null -# email :string(255) default(""), not null -# phone :string(255) -# created_on :datetime not null -# reset_password_token :string(255) -# reset_password_expires :datetime -# last_login :datetime -# - require 'digest/sha1' # specific user rights through memberships (see Group) class User < ActiveRecord::Base @@ -195,3 +177,22 @@ class User < ActiveRecord::Base end end + +# == Schema Information +# +# Table name: users +# +# id :integer(4) not null, primary key +# nick :string(255) default(""), not null +# password_hash :string(255) default(""), not null +# password_salt :string(255) default(""), not null +# first_name :string(255) default(""), not null +# last_name :string(255) default(""), not null +# email :string(255) default(""), not null +# phone :string(255) +# created_on :datetime not null +# reset_password_token :string(255) +# reset_password_expires :datetime +# last_login :datetime +# + diff --git a/app/models/workgroup.rb b/app/models/workgroup.rb index 5d1a33d1..2fae7d83 100644 --- a/app/models/workgroup.rb +++ b/app/models/workgroup.rb @@ -49,28 +49,28 @@ end # # Table name: groups # -# id :integer not null, primary key +# id :integer(4) not null, primary key # type :string(255) default(""), not null # name :string(255) default(""), not null # description :string(255) -# account_balance :decimal(, ) default(0.0), not null +# account_balance :decimal(8, 2) default(0.0), not null # account_updated :datetime # created_on :datetime not null -# role_admin :boolean default(FALSE), not null -# role_suppliers :boolean default(FALSE), not null -# role_article_meta :boolean default(FALSE), not null -# role_finance :boolean default(FALSE), not null -# role_orders :boolean default(FALSE), not null -# weekly_task :boolean default(FALSE) -# weekday :integer +# role_admin :boolean(1) default(FALSE), not null +# role_suppliers :boolean(1) default(FALSE), not null +# role_article_meta :boolean(1) default(FALSE), not null +# role_finance :boolean(1) default(FALSE), not null +# role_orders :boolean(1) default(FALSE), not null +# weekly_task :boolean(1) default(FALSE) +# weekday :integer(4) # task_name :string(255) # task_description :string(255) -# task_required_users :integer default(1) +# task_required_users :integer(4) default(1) # deleted_at :datetime # contact_person :string(255) # contact_phone :string(255) # contact_address :string(255) # stats :text -# task_duration :integer default(1) +# task_duration :integer(4) default(1) # diff --git a/db/schema.rb b/db/schema.rb index 08b216cd..a62d1c3f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -129,28 +129,28 @@ ActiveRecord::Schema.define(:version => 20110507192928) do add_index "group_orders", ["ordergroup_id"], :name => "index_group_orders_on_ordergroup_id" create_table "groups", :force => true do |t| - t.string "type", :default => "", :null => false - t.string "name", :default => "", :null => false + t.string "type", :default => "", :null => false + t.string "name", :default => "", :null => false t.string "description" - t.decimal "account_balance", :default => 0.0, :null => false + t.decimal "account_balance", :precision => 8, :scale => 2, :default => 0.0, :null => false t.datetime "account_updated" - t.datetime "created_on", :null => false - t.boolean "role_admin", :default => false, :null => false - t.boolean "role_suppliers", :default => false, :null => false - t.boolean "role_article_meta", :default => false, :null => false - t.boolean "role_finance", :default => false, :null => false - t.boolean "role_orders", :default => false, :null => false - t.boolean "weekly_task", :default => false + t.datetime "created_on", :null => false + t.boolean "role_admin", :default => false, :null => false + t.boolean "role_suppliers", :default => false, :null => false + t.boolean "role_article_meta", :default => false, :null => false + t.boolean "role_finance", :default => false, :null => false + t.boolean "role_orders", :default => false, :null => false + t.boolean "weekly_task", :default => false t.integer "weekday" t.string "task_name" t.string "task_description" - t.integer "task_required_users", :default => 1 + t.integer "task_required_users", :default => 1 t.datetime "deleted_at" t.string "contact_person" t.string "contact_phone" t.string "contact_address" t.text "stats" - t.integer "task_duration", :default => 1 + t.integer "task_duration", :default => 1 end add_index "groups", ["name"], :name => "index_groups_on_name", :unique => true diff --git a/test/fixtures/article_categories.yml b/test/fixtures/article_categories.yml index 3d2455d2..2d6bd13c 100644 --- a/test/fixtures/article_categories.yml +++ b/test/fixtures/article_categories.yml @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: article_categories -# -# id :integer not null, primary key -# name :string(255) default(""), not null -# description :string(255) -# - # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html fruits: name: Fruits @@ -15,3 +6,13 @@ vegi: name: Vegetables other: name: Other stuff + +# == Schema Information +# +# Table name: article_categories +# +# id :integer(4) not null, primary key +# name :string(255) default(""), not null +# description :string(255) +# + diff --git a/test/fixtures/article_prices.yml b/test/fixtures/article_prices.yml index 3b4c802b..2184911f 100644 --- a/test/fixtures/article_prices.yml +++ b/test/fixtures/article_prices.yml @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: article_prices -# -# id :integer not null, primary key -# article_id :integer -# price :decimal(8, 2) default(0.0), not null -# tax :decimal(8, 2) default(0.0), not null -# deposit :decimal(8, 2) default(0.0), not null -# unit_quantity :integer -# created_at :datetime -# - # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html banana1: @@ -48,3 +35,17 @@ applejuice1: unit_quantity: 1 deposit: 0.15 created_at: <%= Time.now.to_s(:db) %> + +# == Schema Information +# +# Table name: article_prices +# +# id :integer(4) not null, primary key +# article_id :integer(4) +# price :decimal(8, 2) default(0.0), not null +# tax :decimal(8, 2) default(0.0), not null +# deposit :decimal(8, 2) default(0.0), not null +# unit_quantity :integer(4) +# created_at :datetime +# + diff --git a/test/fixtures/articles.yml b/test/fixtures/articles.yml index 636466cc..3fa9adb4 100644 --- a/test/fixtures/articles.yml +++ b/test/fixtures/articles.yml @@ -80,6 +80,7 @@ applejuice: + # == Schema Information # # Table name: articles diff --git a/test/fixtures/assignments.yml b/test/fixtures/assignments.yml index 4c86d30f..bc7748bc 100644 --- a/test/fixtures/assignments.yml +++ b/test/fixtures/assignments.yml @@ -1,12 +1,13 @@ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + # == Schema Information # # Table name: assignments # -# id :integer not null, primary key -# user_id :integer default(0), not null -# task_id :integer default(0), not null -# accepted :boolean default(FALSE) +# id :integer(4) not null, primary key +# user_id :integer(4) default(0), not null +# task_id :integer(4) default(0), not null +# accepted :boolean(1) default(FALSE) # diff --git a/test/fixtures/financial_transactions.yml b/test/fixtures/financial_transactions.yml index 49a3785d..7fc6dbd3 100644 --- a/test/fixtures/financial_transactions.yml +++ b/test/fixtures/financial_transactions.yml @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: financial_transactions -# -# id :integer not null, primary key -# ordergroup_id :integer default(0), not null -# amount :decimal(8, 2) default(0.0), not null -# note :text not null -# user_id :integer default(0), not null -# created_on :datetime not null -# - # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html bananas1: ordergroup: bananas @@ -23,3 +11,16 @@ bananas2: amount: 100.00 note: Paying in from <%= 1.weeks.ago.strftime("%d.%m.%Y") %> created_on: <%= 1.weeks.ago.to_s(:db) %> + +# == Schema Information +# +# Table name: financial_transactions +# +# id :integer(4) not null, primary key +# ordergroup_id :integer(4) default(0), not null +# amount :decimal(8, 2) default(0.0), not null +# note :text default(""), not null +# user_id :integer(4) default(0), not null +# created_on :datetime not null +# + diff --git a/test/fixtures/group_order_article_quantities.yml b/test/fixtures/group_order_article_quantities.yml index 8b9d5e9a..c4685ea7 100644 --- a/test/fixtures/group_order_article_quantities.yml +++ b/test/fixtures/group_order_article_quantities.yml @@ -1,13 +1,14 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + + # == Schema Information # # Table name: group_order_article_quantities # -# id :integer not null, primary key -# group_order_article_id :integer default(0), not null -# quantity :integer default(0) -# tolerance :integer default(0) +# id :integer(4) not null, primary key +# group_order_article_id :integer(4) default(0), not null +# quantity :integer(4) default(0) +# tolerance :integer(4) default(0) # created_on :datetime not null # -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html - diff --git a/test/fixtures/groups.yml b/test/fixtures/groups.yml index bbf6ae9f..0a629e2f 100644 --- a/test/fixtures/groups.yml +++ b/test/fixtures/groups.yml @@ -19,32 +19,33 @@ bananas: + # == Schema Information # # Table name: groups # -# id :integer not null, primary key +# id :integer(4) not null, primary key # type :string(255) default(""), not null # name :string(255) default(""), not null # description :string(255) -# account_balance :decimal(, ) default(0.0), not null +# account_balance :decimal(8, 2) default(0.0), not null # account_updated :datetime # created_on :datetime not null -# role_admin :boolean default(FALSE), not null -# role_suppliers :boolean default(FALSE), not null -# role_article_meta :boolean default(FALSE), not null -# role_finance :boolean default(FALSE), not null -# role_orders :boolean default(FALSE), not null -# weekly_task :boolean default(FALSE) -# weekday :integer +# role_admin :boolean(1) default(FALSE), not null +# role_suppliers :boolean(1) default(FALSE), not null +# role_article_meta :boolean(1) default(FALSE), not null +# role_finance :boolean(1) default(FALSE), not null +# role_orders :boolean(1) default(FALSE), not null +# weekly_task :boolean(1) default(FALSE) +# weekday :integer(4) # task_name :string(255) # task_description :string(255) -# task_required_users :integer default(1) +# task_required_users :integer(4) default(1) # deleted_at :datetime # contact_person :string(255) # contact_phone :string(255) # contact_address :string(255) # stats :text -# task_duration :integer default(1) +# task_duration :integer(4) default(1) # diff --git a/test/fixtures/memberships.yml b/test/fixtures/memberships.yml index b2c0655c..d52b7c87 100644 --- a/test/fixtures/memberships.yml +++ b/test/fixtures/memberships.yml @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: memberships -# -# id :integer not null, primary key -# group_id :integer default(0), not null -# user_id :integer default(0), not null -# - # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html first: group: admins @@ -15,3 +6,13 @@ second: group: bananas user: test + +# == Schema Information +# +# Table name: memberships +# +# id :integer(4) not null, primary key +# group_id :integer(4) default(0), not null +# user_id :integer(4) default(0), not null +# + diff --git a/test/fixtures/messages.yml b/test/fixtures/messages.yml index 68ee7d9d..d8ce3e5b 100644 --- a/test/fixtures/messages.yml +++ b/test/fixtures/messages.yml @@ -1,17 +1,18 @@ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + # == Schema Information # # Table name: messages # -# id :integer not null, primary key -# sender_id :integer +# id :integer(4) not null, primary key +# sender_id :integer(4) # recipients_ids :text # subject :string(255) not null # body :text -# email_state :integer default(0), not null -# private :boolean default(FALSE) +# email_state :integer(4) default(0), not null +# private :boolean(1) default(FALSE) # created_at :datetime # diff --git a/test/fixtures/order_comments.yml b/test/fixtures/order_comments.yml index 411b6add..578adb66 100644 --- a/test/fixtures/order_comments.yml +++ b/test/fixtures/order_comments.yml @@ -1,12 +1,13 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + # == Schema Information # # Table name: order_comments # -# id :integer not null, primary key -# order_id :integer -# user_id :integer +# id :integer(4) not null, primary key +# order_id :integer(4) +# user_id :integer(4) # text :text # created_at :datetime # -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html diff --git a/test/fixtures/orders.yml b/test/fixtures/orders.yml index ad348f0c..5b568a9e 100644 --- a/test/fixtures/orders.yml +++ b/test/fixtures/orders.yml @@ -1,16 +1,17 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + # == Schema Information # # Table name: orders # -# id :integer not null, primary key -# supplier_id :integer +# id :integer(4) not null, primary key +# supplier_id :integer(4) # note :text # starts :datetime # ends :datetime # state :string(255) default("open") -# lock_version :integer default(0), not null -# updated_by_user_id :integer +# lock_version :integer(4) default(0), not null +# updated_by_user_id :integer(4) # foodcoop_result :decimal(8, 2) # -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html diff --git a/test/fixtures/pages.yml b/test/fixtures/pages.yml index 75612d3e..28ac36dd 100644 --- a/test/fixtures/pages.yml +++ b/test/fixtures/pages.yml @@ -10,18 +10,19 @@ two: body: MyText permalink: MyString + # == Schema Information # # Table name: pages # -# id :integer not null, primary key +# id :integer(4) not null, primary key # title :string(255) # body :text # permalink :string(255) -# lock_version :integer default(0) -# updated_by :integer -# redirect :integer -# parent_id :integer +# lock_version :integer(4) default(0) +# updated_by :integer(4) +# redirect :integer(4) +# parent_id :integer(4) # created_at :datetime # updated_at :datetime # diff --git a/test/fixtures/stock_changes.yml b/test/fixtures/stock_changes.yml index 927b7be1..b73ff84e 100644 --- a/test/fixtures/stock_changes.yml +++ b/test/fixtures/stock_changes.yml @@ -1,14 +1,15 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + # == Schema Information # # Table name: stock_changes # -# id :integer not null, primary key -# delivery_id :integer -# order_id :integer -# stock_article_id :integer -# quantity :integer default(0) +# id :integer(4) not null, primary key +# delivery_id :integer(4) +# order_id :integer(4) +# stock_article_id :integer(4) +# quantity :integer(4) default(0) # created_at :datetime -# stock_taking_id :integer +# stock_taking_id :integer(4) # -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html diff --git a/test/fixtures/stock_takings.yml b/test/fixtures/stock_takings.yml index 19990b41..76c92f53 100644 --- a/test/fixtures/stock_takings.yml +++ b/test/fixtures/stock_takings.yml @@ -1,12 +1,13 @@ +# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + + # == Schema Information # # Table name: stock_takings # -# id :integer not null, primary key +# id :integer(4) not null, primary key # date :date # note :text # created_at :datetime # -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html - diff --git a/test/fixtures/suppliers.yml b/test/fixtures/suppliers.yml index 9849fd7f..7999fb92 100644 --- a/test/fixtures/suppliers.yml +++ b/test/fixtures/suppliers.yml @@ -45,6 +45,8 @@ terra: + + # == Schema Information # # Table name: suppliers diff --git a/test/fixtures/tasks.yml b/test/fixtures/tasks.yml index 538e2b3c..d6e38b5d 100644 --- a/test/fixtures/tasks.yml +++ b/test/fixtures/tasks.yml @@ -1,21 +1,22 @@ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html + # == Schema Information # # Table name: tasks # -# id :integer not null, primary key +# id :integer(4) not null, primary key # name :string(255) default(""), not null # description :string(255) # due_date :date -# done :boolean default(FALSE) -# workgroup_id :integer -# assigned :boolean default(FALSE) +# done :boolean(1) default(FALSE) +# workgroup_id :integer(4) +# assigned :boolean(1) default(FALSE) # created_on :datetime not null # updated_on :datetime not null -# required_users :integer default(1) -# weekly :boolean -# duration :integer default(1) +# required_users :integer(4) default(1) +# weekly :boolean(1) +# duration :integer(4) default(1) # diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index e130c34d..da16ed74 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -1,21 +1,3 @@ -# == Schema Information -# -# Table name: users -# -# id :integer not null, primary key -# nick :string(255) default(""), not null -# password_hash :string(255) default(""), not null -# password_salt :string(255) default(""), not null -# first_name :string(255) default(""), not null -# last_name :string(255) default(""), not null -# email :string(255) default(""), not null -# phone :string(255) -# created_on :datetime not null -# reset_password_token :string(255) -# reset_password_expires :datetime -# last_login :datetime -# - # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html admin: nick: admin @@ -33,3 +15,22 @@ test: password_hash: 5549cd54032a72435037893b02d95ebef13cdc57 password_salt: DxnbIF1h created_on: <%= Time.now.to_s(:db) %> + +# == Schema Information +# +# Table name: users +# +# id :integer(4) not null, primary key +# nick :string(255) default(""), not null +# password_hash :string(255) default(""), not null +# password_salt :string(255) default(""), not null +# first_name :string(255) default(""), not null +# last_name :string(255) default(""), not null +# email :string(255) default(""), not null +# phone :string(255) +# created_on :datetime not null +# reset_password_token :string(255) +# reset_password_expires :datetime +# last_login :datetime +# + diff --git a/test/unit/article_category_test.rb b/test/unit/article_category_test.rb index f90150b3..e51a1ead 100644 --- a/test/unit/article_category_test.rb +++ b/test/unit/article_category_test.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: article_categories -# -# id :integer not null, primary key -# name :string(255) default(""), not null -# description :string(255) -# - require File.dirname(__FILE__) + '/../test_helper' class ArticleCategoryTest < Test::Unit::TestCase @@ -17,3 +8,13 @@ class ArticleCategoryTest < Test::Unit::TestCase assert true end end + +# == Schema Information +# +# Table name: article_categories +# +# id :integer(4) not null, primary key +# name :string(255) default(""), not null +# description :string(255) +# + diff --git a/test/unit/article_price_test.rb b/test/unit/article_price_test.rb index 48c037db..91ec43ff 100644 --- a/test/unit/article_price_test.rb +++ b/test/unit/article_price_test.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: article_prices -# -# id :integer not null, primary key -# article_id :integer -# price :decimal(8, 2) default(0.0), not null -# tax :decimal(8, 2) default(0.0), not null -# deposit :decimal(8, 2) default(0.0), not null -# unit_quantity :integer -# created_at :datetime -# - require 'test_helper' class ArticlePriceTest < ActiveSupport::TestCase @@ -19,3 +6,17 @@ class ArticlePriceTest < ActiveSupport::TestCase assert true end end + +# == Schema Information +# +# Table name: article_prices +# +# id :integer(4) not null, primary key +# article_id :integer(4) +# price :decimal(8, 2) default(0.0), not null +# tax :decimal(8, 2) default(0.0), not null +# deposit :decimal(8, 2) default(0.0), not null +# unit_quantity :integer(4) +# created_at :datetime +# + diff --git a/test/unit/assignment_test.rb b/test/unit/assignment_test.rb index b9d6fc50..030ae4c3 100644 --- a/test/unit/assignment_test.rb +++ b/test/unit/assignment_test.rb @@ -9,13 +9,14 @@ class AssignmentTest < Test::Unit::TestCase end end + # == Schema Information # # Table name: assignments # -# id :integer not null, primary key -# user_id :integer default(0), not null -# task_id :integer default(0), not null -# accepted :boolean default(FALSE) +# id :integer(4) not null, primary key +# user_id :integer(4) default(0), not null +# task_id :integer(4) default(0), not null +# accepted :boolean(1) default(FALSE) # diff --git a/test/unit/financial_transaction_test.rb b/test/unit/financial_transaction_test.rb index a4f4c442..c9eac54d 100644 --- a/test/unit/financial_transaction_test.rb +++ b/test/unit/financial_transaction_test.rb @@ -1,15 +1,3 @@ -# == Schema Information -# -# Table name: financial_transactions -# -# id :integer not null, primary key -# ordergroup_id :integer default(0), not null -# amount :decimal(8, 2) default(0.0), not null -# note :text not null -# user_id :integer default(0), not null -# created_on :datetime not null -# - require File.dirname(__FILE__) + '/../test_helper' class FinancialTransactionTest < Test::Unit::TestCase @@ -20,3 +8,16 @@ class FinancialTransactionTest < Test::Unit::TestCase assert true end end + +# == Schema Information +# +# Table name: financial_transactions +# +# id :integer(4) not null, primary key +# ordergroup_id :integer(4) default(0), not null +# amount :decimal(8, 2) default(0.0), not null +# note :text default(""), not null +# user_id :integer(4) default(0), not null +# created_on :datetime not null +# + diff --git a/test/unit/group_order_article_quantity_test.rb b/test/unit/group_order_article_quantity_test.rb index 3368e555..175ba34c 100644 --- a/test/unit/group_order_article_quantity_test.rb +++ b/test/unit/group_order_article_quantity_test.rb @@ -1,14 +1,3 @@ -# == Schema Information -# -# Table name: group_order_article_quantities -# -# id :integer not null, primary key -# group_order_article_id :integer default(0), not null -# quantity :integer default(0) -# tolerance :integer default(0) -# created_on :datetime not null -# - require File.dirname(__FILE__) + '/../test_helper' class GroupOrderArticleQuantityTest < Test::Unit::TestCase @@ -19,3 +8,15 @@ class GroupOrderArticleQuantityTest < Test::Unit::TestCase assert true end end + +# == Schema Information +# +# Table name: group_order_article_quantities +# +# id :integer(4) not null, primary key +# group_order_article_id :integer(4) default(0), not null +# quantity :integer(4) default(0) +# tolerance :integer(4) default(0) +# created_on :datetime not null +# + diff --git a/test/unit/group_test.rb b/test/unit/group_test.rb index 83ae9bb9..9fb911e5 100644 --- a/test/unit/group_test.rb +++ b/test/unit/group_test.rb @@ -11,32 +11,33 @@ end + # == Schema Information # # Table name: groups # -# id :integer not null, primary key +# id :integer(4) not null, primary key # type :string(255) default(""), not null # name :string(255) default(""), not null # description :string(255) -# account_balance :decimal(, ) default(0.0), not null +# account_balance :decimal(8, 2) default(0.0), not null # account_updated :datetime # created_on :datetime not null -# role_admin :boolean default(FALSE), not null -# role_suppliers :boolean default(FALSE), not null -# role_article_meta :boolean default(FALSE), not null -# role_finance :boolean default(FALSE), not null -# role_orders :boolean default(FALSE), not null -# weekly_task :boolean default(FALSE) -# weekday :integer +# role_admin :boolean(1) default(FALSE), not null +# role_suppliers :boolean(1) default(FALSE), not null +# role_article_meta :boolean(1) default(FALSE), not null +# role_finance :boolean(1) default(FALSE), not null +# role_orders :boolean(1) default(FALSE), not null +# weekly_task :boolean(1) default(FALSE) +# weekday :integer(4) # task_name :string(255) # task_description :string(255) -# task_required_users :integer default(1) +# task_required_users :integer(4) default(1) # deleted_at :datetime # contact_person :string(255) # contact_phone :string(255) # contact_address :string(255) # stats :text -# task_duration :integer default(1) +# task_duration :integer(4) default(1) # diff --git a/test/unit/membership_test.rb b/test/unit/membership_test.rb index 07aa4f39..04d21fa5 100644 --- a/test/unit/membership_test.rb +++ b/test/unit/membership_test.rb @@ -1,12 +1,3 @@ -# == Schema Information -# -# Table name: memberships -# -# id :integer not null, primary key -# group_id :integer default(0), not null -# user_id :integer default(0), not null -# - require File.dirname(__FILE__) + '/../test_helper' class MembershipTest < Test::Unit::TestCase @@ -17,3 +8,13 @@ class MembershipTest < Test::Unit::TestCase assert true end end + +# == Schema Information +# +# Table name: memberships +# +# id :integer(4) not null, primary key +# group_id :integer(4) default(0), not null +# user_id :integer(4) default(0), not null +# + diff --git a/test/unit/order_comment_test.rb b/test/unit/order_comment_test.rb index 1c2bcb1f..a9715280 100644 --- a/test/unit/order_comment_test.rb +++ b/test/unit/order_comment_test.rb @@ -1,14 +1,3 @@ -# == Schema Information -# -# Table name: order_comments -# -# id :integer not null, primary key -# order_id :integer -# user_id :integer -# text :text -# created_at :datetime -# - require 'test_helper' class OrderCommentTest < ActiveSupport::TestCase @@ -17,3 +6,15 @@ class OrderCommentTest < ActiveSupport::TestCase assert true end end + +# == Schema Information +# +# Table name: order_comments +# +# id :integer(4) not null, primary key +# order_id :integer(4) +# user_id :integer(4) +# text :text +# created_at :datetime +# + diff --git a/test/unit/order_test.rb b/test/unit/order_test.rb index 904d02bf..6ff760b2 100644 --- a/test/unit/order_test.rb +++ b/test/unit/order_test.rb @@ -1,18 +1,3 @@ -# == Schema Information -# -# Table name: orders -# -# id :integer not null, primary key -# supplier_id :integer -# note :text -# starts :datetime -# ends :datetime -# state :string(255) default("open") -# lock_version :integer default(0), not null -# updated_by_user_id :integer -# foodcoop_result :decimal(8, 2) -# - require File.dirname(__FILE__) + '/../test_helper' class OrderTest < Test::Unit::TestCase @@ -23,3 +8,19 @@ class OrderTest < Test::Unit::TestCase assert true end end + +# == Schema Information +# +# Table name: orders +# +# id :integer(4) not null, primary key +# supplier_id :integer(4) +# note :text +# starts :datetime +# ends :datetime +# state :string(255) default("open") +# lock_version :integer(4) default(0), not null +# updated_by_user_id :integer(4) +# foodcoop_result :decimal(8, 2) +# + diff --git a/test/unit/page_test.rb b/test/unit/page_test.rb index 4d47d971..1e95d99d 100644 --- a/test/unit/page_test.rb +++ b/test/unit/page_test.rb @@ -7,18 +7,19 @@ class PageTest < ActiveSupport::TestCase end end + # == Schema Information # # Table name: pages # -# id :integer not null, primary key +# id :integer(4) not null, primary key # title :string(255) # body :text # permalink :string(255) -# lock_version :integer default(0) -# updated_by :integer -# redirect :integer -# parent_id :integer +# lock_version :integer(4) default(0) +# updated_by :integer(4) +# redirect :integer(4) +# parent_id :integer(4) # created_at :datetime # updated_at :datetime # diff --git a/test/unit/stock_article_test.rb b/test/unit/stock_article_test.rb index 8fa1aeee..3808039a 100644 --- a/test/unit/stock_article_test.rb +++ b/test/unit/stock_article_test.rb @@ -7,29 +7,30 @@ class StockArticleTest < ActiveSupport::TestCase end end + # == Schema Information # # Table name: articles # -# id :integer not null, primary key +# id :integer(4) not null, primary key # name :string(255) default(""), not null -# supplier_id :integer default(0), not null -# article_category_id :integer default(0), not null +# supplier_id :integer(4) default(0), not null +# article_category_id :integer(4) default(0), not null # unit :string(255) default(""), not null # note :string(255) -# availability :boolean default(TRUE), not null +# availability :boolean(1) default(TRUE), not null # manufacturer :string(255) # origin :string(255) # shared_updated_on :datetime # price :decimal(8, 2) # tax :float # deposit :decimal(8, 2) default(0.0) -# unit_quantity :integer default(1), not null +# unit_quantity :integer(4) default(1), not null # order_number :string(255) # created_at :datetime # updated_at :datetime # deleted_at :datetime # type :string(255) -# quantity :integer default(0) +# quantity :integer(4) default(0) # diff --git a/test/unit/stock_change_test.rb b/test/unit/stock_change_test.rb index 2524c312..12905bc3 100644 --- a/test/unit/stock_change_test.rb +++ b/test/unit/stock_change_test.rb @@ -1,16 +1,3 @@ -# == Schema Information -# -# Table name: stock_changes -# -# id :integer not null, primary key -# delivery_id :integer -# order_id :integer -# stock_article_id :integer -# quantity :integer default(0) -# created_at :datetime -# stock_taking_id :integer -# - require 'test_helper' class StockChangeTest < ActiveSupport::TestCase @@ -19,3 +6,17 @@ class StockChangeTest < ActiveSupport::TestCase assert true end end + +# == Schema Information +# +# Table name: stock_changes +# +# id :integer(4) not null, primary key +# delivery_id :integer(4) +# order_id :integer(4) +# stock_article_id :integer(4) +# quantity :integer(4) default(0) +# created_at :datetime +# stock_taking_id :integer(4) +# + diff --git a/test/unit/stock_taking_test.rb b/test/unit/stock_taking_test.rb index 7cd4832e..aeb5da29 100644 --- a/test/unit/stock_taking_test.rb +++ b/test/unit/stock_taking_test.rb @@ -1,13 +1,3 @@ -# == Schema Information -# -# Table name: stock_takings -# -# id :integer not null, primary key -# date :date -# note :text -# created_at :datetime -# - require 'test_helper' class StockTakingTest < ActiveSupport::TestCase @@ -16,3 +6,14 @@ class StockTakingTest < ActiveSupport::TestCase assert true end end + +# == Schema Information +# +# Table name: stock_takings +# +# id :integer(4) not null, primary key +# date :date +# note :text +# created_at :datetime +# + diff --git a/test/unit/supplier_test.rb b/test/unit/supplier_test.rb index 5672caab..edbf32af 100644 --- a/test/unit/supplier_test.rb +++ b/test/unit/supplier_test.rb @@ -1,25 +1,3 @@ -# == Schema Information -# -# Table name: suppliers -# -# id :integer not null, primary key -# name :string(255) default(""), not null -# address :string(255) default(""), not null -# phone :string(255) default(""), not null -# phone2 :string(255) -# fax :string(255) -# email :string(255) -# url :string(255) -# contact_person :string(255) -# customer_number :string(255) -# delivery_days :string(255) -# order_howto :string(255) -# note :string(255) -# shared_supplier_id :integer -# min_order_quantity :string(255) -# deleted_at :datetime -# - require File.dirname(__FILE__) + '/../test_helper' class SupplierTest < Test::Unit::TestCase @@ -42,3 +20,26 @@ class SupplierTest < Test::Unit::TestCase assert_equal 'wednesday', @supplier.delivery_days end end + +# == Schema Information +# +# Table name: suppliers +# +# id :integer(4) not null, primary key +# name :string(255) default(""), not null +# address :string(255) default(""), not null +# phone :string(255) default(""), not null +# phone2 :string(255) +# fax :string(255) +# email :string(255) +# url :string(255) +# contact_person :string(255) +# customer_number :string(255) +# delivery_days :string(255) +# order_howto :string(255) +# note :string(255) +# shared_supplier_id :integer(4) +# min_order_quantity :string(255) +# deleted_at :datetime +# + diff --git a/test/unit/task_test.rb b/test/unit/task_test.rb index dc3ae5aa..af6b935d 100644 --- a/test/unit/task_test.rb +++ b/test/unit/task_test.rb @@ -10,21 +10,22 @@ class TaskTest < Test::Unit::TestCase end + # == Schema Information # # Table name: tasks # -# id :integer not null, primary key +# id :integer(4) not null, primary key # name :string(255) default(""), not null # description :string(255) # due_date :date -# done :boolean default(FALSE) -# workgroup_id :integer -# assigned :boolean default(FALSE) +# done :boolean(1) default(FALSE) +# workgroup_id :integer(4) +# assigned :boolean(1) default(FALSE) # created_on :datetime not null # updated_on :datetime not null -# required_users :integer default(1) -# weekly :boolean -# duration :integer default(1) +# required_users :integer(4) default(1) +# weekly :boolean(1) +# duration :integer(4) default(1) # diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index b6382acd..38e82adb 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -1,21 +1,3 @@ -# == Schema Information -# -# Table name: users -# -# id :integer not null, primary key -# nick :string(255) default(""), not null -# password_hash :string(255) default(""), not null -# password_salt :string(255) default(""), not null -# first_name :string(255) default(""), not null -# last_name :string(255) default(""), not null -# email :string(255) default(""), not null -# phone :string(255) -# created_on :datetime not null -# reset_password_token :string(255) -# reset_password_expires :datetime -# last_login :datetime -# - require File.dirname(__FILE__) + '/../test_helper' class UserTest < Test::Unit::TestCase @@ -49,3 +31,22 @@ class UserTest < Test::Unit::TestCase assert_equal 'Passworteingaben stimmen nicht überein', @admin.errors.on_base end end + +# == Schema Information +# +# Table name: users +# +# id :integer(4) not null, primary key +# nick :string(255) default(""), not null +# password_hash :string(255) default(""), not null +# password_salt :string(255) default(""), not null +# first_name :string(255) default(""), not null +# last_name :string(255) default(""), not null +# email :string(255) default(""), not null +# phone :string(255) +# created_on :datetime not null +# reset_password_token :string(255) +# reset_password_expires :datetime +# last_login :datetime +# + diff --git a/test/unit/workgroup_test.rb b/test/unit/workgroup_test.rb index 189c3276..7c88d19c 100644 --- a/test/unit/workgroup_test.rb +++ b/test/unit/workgroup_test.rb @@ -9,32 +9,33 @@ end + # == Schema Information # # Table name: groups # -# id :integer not null, primary key +# id :integer(4) not null, primary key # type :string(255) default(""), not null # name :string(255) default(""), not null # description :string(255) -# account_balance :decimal(, ) default(0.0), not null +# account_balance :decimal(8, 2) default(0.0), not null # account_updated :datetime # created_on :datetime not null -# role_admin :boolean default(FALSE), not null -# role_suppliers :boolean default(FALSE), not null -# role_article_meta :boolean default(FALSE), not null -# role_finance :boolean default(FALSE), not null -# role_orders :boolean default(FALSE), not null -# weekly_task :boolean default(FALSE) -# weekday :integer +# role_admin :boolean(1) default(FALSE), not null +# role_suppliers :boolean(1) default(FALSE), not null +# role_article_meta :boolean(1) default(FALSE), not null +# role_finance :boolean(1) default(FALSE), not null +# role_orders :boolean(1) default(FALSE), not null +# weekly_task :boolean(1) default(FALSE) +# weekday :integer(4) # task_name :string(255) # task_description :string(255) -# task_required_users :integer default(1) +# task_required_users :integer(4) default(1) # deleted_at :datetime # contact_person :string(255) # contact_phone :string(255) # contact_address :string(255) # stats :text -# task_duration :integer default(1) +# task_duration :integer(4) default(1) #