Skip to content

Commit

Permalink
refactor: remove dependency from migration_comments
Browse files Browse the repository at this point in the history
  • Loading branch information
artofhuman committed Sep 21, 2016
1 parent c157718 commit c7659b1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
source "https://gems.railsc.ru"
source "https://rubygems.org"

group :development, :test do
gem "combustion", github: "abak-press/combustion"
end

if RUBY_VERSION < '2'
gem 'mime-types', '< 3.0'
gem 'migration_comments', '= 0.3.2'
gem 'json', '< 2.0.0'
gem 'rack', '< 2.0.0'
end
Expand Down
3 changes: 1 addition & 2 deletions apress-api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ Gem::Specification.new do |spec|
spec.add_runtime_dependency "multi_json", ">= 1.11.2"
spec.add_runtime_dependency "jbuilder", ">= 2.3.1"
spec.add_runtime_dependency "attr_extras", ">= 4.4.0"
spec.add_runtime_dependency "migration_comments", ">= 0.3.2"
spec.add_runtime_dependency 'swagger-blocks', '>= 1.3'

spec.add_development_dependency "bundler", "~> 1.7"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "rspec", ">= 3.2"
spec.add_development_dependency "rspec-rails", ">= 3.2"
spec.add_development_dependency "combustion", ">= 0.5.3"
spec.add_development_dependency "combustion", ">= 0.5.4"
spec.add_development_dependency "appraisal"
spec.add_development_dependency "pry-debugger"
spec.add_development_dependency "timecop"
Expand Down
24 changes: 15 additions & 9 deletions db/migrate/20150716000000_create_api_clients.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
# coding: utf-8
require "migration_comments"

class CreateApiClients < ActiveRecord::Migration
def up
create_table :api_clients, comment: "Пользователи API" do |t|
t.string :access_id, null: false, limit: 36, comment: "Уникальный ID пользователя"
t.string :secret_token, null: false, comment: "Секретный ключ для подписи запроса"
t.datetime :secret_token_expire_at, null: false, comment: "Время протухания"
t.string :refresh_token, null: false, comment: "Ключ для получения нового секретного ключа"
t.datetime :refresh_token_expire_at, null: false, comment: "Время протухания"
t.string :user_agent, comment: "User-Agent пользователя"
create_table :api_clients do |t|
t.string :access_id, null: false, limit: 36
t.string :secret_token, null: false
t.datetime :secret_token_expire_at, null: false
t.string :refresh_token, null: false
t.datetime :refresh_token_expire_at, null: false
t.string :user_agent
t.timestamps null: false
end

execute <<-SQL
COMMENT ON TABLE api_clients IS 'Пользователи API';
COMMENT ON COLUMN api_clients.access_id IS 'Уникальный ID пользователя';
COMMENT ON COLUMN api_clients.secret_token IS 'Секретный ключ для подписи запроса';
COMMENT ON COLUMN api_clients.secret_token_expire_at IS 'Время протухания';
COMMENT ON COLUMN api_clients.refresh_token IS 'Ключ для получения нового секретного ключа';
COMMENT ON COLUMN api_clients.refresh_token_expire_at IS 'Время протухания';
COMMENT ON COLUMN api_clients.user_agent IS 'User-Agent пользователя';
ALTER TABLE api_clients
ADD CONSTRAINT uniq_api_clients_on_access_id
UNIQUE(access_id)
Expand Down

0 comments on commit c7659b1

Please sign in to comment.