All Projects → ioquatix → activerecord-migrations

ioquatix / activerecord-migrations

Licence: other
A gem to simplify activerecord migrations in non-rails projects.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to activerecord-migrations

Ldaprecord
A fully-featured LDAP framework.
Stars: ✭ 159 (+960%)
Mutual labels:  activerecord
Randumb
Adds ability to pull back random records from Active Record
Stars: ✭ 208 (+1286.67%)
Mutual labels:  activerecord
Activerecord Postgres enum
Integrate PostgreSQL's enum data type into ActiveRecord's schema and migrations.
Stars: ✭ 227 (+1413.33%)
Mutual labels:  activerecord
Ldaprecord Laravel
Multi-domain LDAP Authentication & Management for Laravel.
Stars: ✭ 178 (+1086.67%)
Mutual labels:  activerecord
Jsonapi Utils
Build JSON API-compliant APIs on Rails with no (or less) learning curve.
Stars: ✭ 191 (+1173.33%)
Mutual labels:  activerecord
Secondbase
Seamless second database integration for Rails.
Stars: ✭ 216 (+1340%)
Mutual labels:  activerecord
Querybuilder
SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
Stars: ✭ 2,111 (+13973.33%)
Mutual labels:  activerecord
n1 loader
Loader to solve N+1 issues for good. Highly recommended for GraphQL API.
Stars: ✭ 182 (+1113.33%)
Mutual labels:  activerecord
Activerecord Turntable
ActiveRecord Sharding Plugin
Stars: ✭ 206 (+1273.33%)
Mutual labels:  activerecord
Octopus
Database Sharding for ActiveRecord
Stars: ✭ 2,496 (+16540%)
Mutual labels:  activerecord
Ooor
Odoo Ruby JSON client. Emulates ActiveRecord enough (as much as Mongoid; Implements ActiveModel) to make Rails development with an Odoo datastore straightforward
Stars: ✭ 184 (+1126.67%)
Mutual labels:  activerecord
Ar Softdelete
Soft delete behavior for ActiveRecord
Stars: ✭ 188 (+1153.33%)
Mutual labels:  activerecord
Activerecord json validator
🔩 ActiveRecord::JSONValidator makes it easy to validate JSON attributes against a JSON schema.
Stars: ✭ 220 (+1366.67%)
Mutual labels:  activerecord
Activejpa
A simple active record pattern library in java that makes programming DAL easier
Stars: ✭ 172 (+1046.67%)
Mutual labels:  activerecord
Occams Record
The missing high-efficiency query API for ActiveRecord
Stars: ✭ 240 (+1500%)
Mutual labels:  activerecord
Coloquent
Javascript/Typescript library mapping objects and their interrelations to JSON API, with a clean, fluent ActiveRecord-like (e.g. similar to Laravel's Eloquent) syntax for creating, retrieving, updating and deleting model objects.
Stars: ✭ 149 (+893.33%)
Mutual labels:  activerecord
Anima
Minimal database operation library.
Stars: ✭ 210 (+1300%)
Mutual labels:  activerecord
query-objects-example
Example of rails app using Query Objects
Stars: ✭ 37 (+146.67%)
Mutual labels:  activerecord
Scenic
Scenic is maintained by Derek Prior, Caleb Hearth, and you, our contributors.
Stars: ✭ 2,856 (+18940%)
Mutual labels:  activerecord
Seamless database pool
Add support for master/slave database clusters in ActiveRecord to improve performance.
Stars: ✭ 222 (+1380%)
Mutual labels:  activerecord

ActiveRecord::Migrations

This gem provides opinionated support for ActiveRecord migrations in non-Rails applications. It's more opinionated than active_record_migrations and standalone-migrations, and therefore simpler to configure.

Build Status Code Climate Coverage Status

Installation

Add this line to your application's Gemfile:

gem 'activerecord-migrations'

Usage

Add something like this to tasks/db.rake

require 'active_record/migrations/tasks'
# The root must be the root of your application, and contain `db/`.
ActiveRecord::Migrations.root = File.dirname(__dir__)

Somewhere else, ensure you have a suitable environment task, e.g:

task :environment do
	# This must be a symbol... or establish_connection thinks it's a URL.
	DATABASE_ENV = :development
	
	ActiveRecord::Base.configurations = {
		# This key must be a string or it will not be matched by ActiveRecord:
		'development' => {
			# Using symbols for keys is fixed by this gem.
			adapter: 'sqlite3',
			database: 'db/development.db'
		}
	}
	
	# Connect to database:
	unless ActiveRecord::Base.connected?
		ActiveRecord::Base.establish_connection(DATABASE_ENV)
	end
end

Deployment

This gem includes an additional task db:deploy which is designed to assist with deployment of sites with databases. When deploying a site for the first time, this task will create the database and load the seed data, then run any outstanding migrations. If deploying the site to an existing database it will simply run migrations.

The typical usage is to run db:fixtures:update which will generate all the required files into db/fixtures/$DATABASE/, which includes the contents of all tables and the current schema.rb.

Fixtures

Fixtures are generated into db/fixtures/$DATABASE_ENV/$TABLE_NAME.yml by running rake db:fixtures:dump. You can limit this to specific tables by editing db/fixtures/$DATABASE_ENV/tables.conf which is loaded if present, or by specifying TABLES=table1,table2 environment variable.

Seed

This gem replaces the existing data seed mechanism with db:fixtures:load.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

See Also

License

Released under the MIT license.

Copyright, 2016, by Samuel G. D. Williams.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].