diff --git a/Gemfile b/Gemfile index afa112ba..d0ed3fe6 100644 --- a/Gemfile +++ b/Gemfile @@ -56,12 +56,12 @@ gem 'midi-smtp-server' gem 'acts_as_versioned', git: 'https://github.com/technoweenie/acts_as_versioned.git' gem 'foodsoft_wiki', path: 'plugins/wiki' gem 'foodsoft_messages', path: 'plugins/messages' +gem 'foodsoft_documents', path: 'plugins/documents' gem 'foodsoft_discourse', path: 'plugins/discourse' # plugins not enabled by default #gem 'foodsoft_current_orders', path: 'plugins/current_orders' #gem 'foodsoft_uservoice', path: 'plugins/uservoice' -#gem 'foodsoft_documents', path: 'plugins/documents' group :development do diff --git a/Gemfile.lock b/Gemfile.lock index d38e9439..03a7d75c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,6 +18,14 @@ PATH deface (~> 1.0) rails +PATH + remote: plugins/documents + specs: + foodsoft_documents (0.0.1) + deface (~> 1.0) + rails + ruby-filemagic + PATH remote: plugins/messages specs: @@ -513,6 +521,7 @@ DEPENDENCIES factory_girl_rails faker foodsoft_discourse! + foodsoft_documents! foodsoft_messages! foodsoft_wiki! gaffe diff --git a/db/migrate/20160220000000_create_documents.foodsoft_documents_engine.rb b/db/migrate/20160220000000_create_documents.foodsoft_documents_engine.rb new file mode 100644 index 00000000..ac82e3e7 --- /dev/null +++ b/db/migrate/20160220000000_create_documents.foodsoft_documents_engine.rb @@ -0,0 +1,15 @@ +class CreateDocuments < ActiveRecord::Migration + def self.up + create_table :documents do |t| + t.string :name + t.string :mime + t.binary :data, limit: 16.megabyte + t.integer :created_by_user_id + t.timestamps + end + end + + def self.down + drop_table :documents + end +end diff --git a/db/schema.rb b/db/schema.rb index 52540fa3..884e3f81 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -76,6 +76,15 @@ ActiveRecord::Schema.define(version: 20171001000000) do add_index "deliveries", ["supplier_id"], name: "index_deliveries_on_supplier_id", using: :btree + create_table "documents", force: :cascade do |t| + t.string "name" + t.string "mime" + t.binary "data" + t.integer "created_by_user_id" + t.datetime "created_at" + t.datetime "updated_at" + end + create_table "financial_transactions", force: :cascade do |t| t.integer "ordergroup_id", limit: 4, default: 0, null: false t.decimal "amount", precision: 8, scale: 2, default: 0, null: false