Sha256: e0e264f8f9b55c1299c44f78123b9309aefb0eea7f451c2ab3a4a05c96afe9c1

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

module Souls
  module Api
    module Generate
      class << self
        def create_migration(class_name: "user")
          pluralized_class_name = class_name.underscore.pluralize
          system("rake db:create_migration NAME=create_#{pluralized_class_name}")
        end

        def add_column(class_name: "user")
          pluralized_class_name = class_name.underscore.pluralize
          system("rake db:create_migration NAME=add_#{pluralized_class_name}")
        end

        def rename_column(class_name: "user")
          pluralized_class_name = class_name.underscore.pluralize
          system("rake db:create_migration NAME=rename_#{pluralized_class_name}")
        end

        def change_column(class_name: "user")
          pluralized_class_name = class_name.underscore.pluralize
          system("rake db:create_migration NAME=change_#{pluralized_class_name}")
        end

        def remove_column(class_name: "user")
          pluralized_class_name = class_name.underscore.pluralize
          system("rake db:create_migration NAME=remove_#{pluralized_class_name}")
        end

        def drop_table(class_name: "user")
          pluralized_class_name = class_name.underscore.pluralize
          system("rake db:create_migration NAME=drop_#{pluralized_class_name}")
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
souls-0.29.5 lib/souls/api/generate/migration.rb