github.com

...versions (e.g. Ruby 2.1.8, Ruby 2.3.1). Test one codebase against multiple database types (currently MySQL or PostgreSQL). Compute a matrix of all possible dependency permutations (Ruby, gem set, database type...

...does not work with Ruby 2.1). Let developers enter their local credentials for MySQL and PostgreSQL in a database.yml file. Define default Ruby version, gem dependencies and database for developers...

...If necessary (i.e. the tests use databases), add a spec/support/database.github.yml file with this content: mysql: database: test username: root password: password host: 127.0.0.1 port: 3306 postgresql: database: test host: localhost...

...version that is actually in the matrix. You might run into issues with the mysql2 gem, including issues bundling, and even segfaults. Use this card to fix these issues.

github.com

...s query parsing and LIKE query functionality. Minidusen can no longer index text in MySQL FULLTEXT columns, which was hardly used and didn't always help performance due to the...

...cost of reindexing. Minidusen is currently compatible with MySQL, PostgreSQL, Rails 3.2, Rails 4.2 and Rails 5.0. Basic Usage Our example will be a simple address book: class Contact < ActiveRecord...

...thought. While you can call ActiveRecord::Base.connection.execute(sql) to execute arbitrary SQL commands, the MySQL connection is configured to only accept a single statement per query. If you try to...

...error in your SQL syntax. You can work around this by opening a second MySQL connection that does accept multiple statements per call. Below is an example for a migration...

We upgraded a Rails 2 application to Rails 3.2 and Ruby 2.1, changed the mysql adapter from mysql to mysql2, but did not activitate the asset pipeline. Instead we used...

makandra dev
github.com

...working directory and ~/dumps (for dumps created with geordi). geordi drop_databases Delete local MySQL/MariaDB and Postgres databases that are not whitelisted. Authentication is handled via PAM for Postgres and...

...MariaDB, via .my.cnf with fallback to mysql -p for MySQL. Different connection methods can be chosen via command line switches, e.g. for cleaning up multiple local database server installations in...

You might have a table without a primary key set in MySQL. You can fix this by adding a primary key index to the guilty MySQL table, or by setting...

If you have many connections to your MySQL or MariaDB (as we have) you might want to filter the list you see when running a SHOW PROCESSLIST. To hide all...

There is an more advanced way by querying the information_schema database: Show MySQL process list without sleeping connections

If you upgrade to the mysql2 gem, you will run into the problem that the server's database.yml (which is usually not under version control) needs to change exactly on...

You can however make your database.yml work for mysql and mysql2 at the same time. Simpy do this production: adapter: <%= defined?(Mysql2) ? 'mysql2' : 'mysql...

makandra dev

...that checks out a feature branch based on a story from Pivotal Tracker Faster MySQL dumping with --single-transaction and --quick Allow pivotal tracker ids in the global config file...

makandra dev

...the Rails 2.3.8 gem." you forgot to bundle Rails. If you see "Missing the mysql gem", bundle that as well. Add both Gemfile as well as Gemfile.lock to the repository...

...NUMBER'] %> appended to the database name in the test section. # ./config/database.yml ... test: &TEST adapter: mysql database: my_database_name_test<%= ENV['TEST_ENV_NUMBER'] %> encoding: utf8 username: xxx password: yyy...

...actually never be written to the database, because we disconnected during an unfinished transaction. MySQL will for good reason not simply commit any open transactions when you disconnect (you might...

...as_geocodable using plain Graticule will just do the job. Support from the database MySQL 5 has spatial support. This involves custom data types and funny SQL syntax.

makandra dev

...e.g. rails console staging Gem updates Replace ruby-debug with byebug or pry Replace mysql with mysql2, '< 0.3' Remove oniguruma Remove net-ssh and net-scp Remove fastercsv Remove cucumber...

...scope chain, it only mashes together strings that mostly happen to look like a MySQL query in the end. I don't generally advice against using scopes with JOINs. What...

...to you database and database table charsets to UTF8. You can check in the MySQL console with SHOW VARIABLES LIKE "character_set_database"; SHOW TABLE STATUS; Also update your nbsp...

...I measured the runtime of different strategies using an average-sized Rails project (with MySQL): Cucumber RSpec Transaction 87.14, 86.65 10.20, 10.11 Truncation 90.43, 90.69 26.82, 26.46

MariaDB (and MySQL) is released in different versions with different behaviors. For backwards compatibility this can be managed with the sql_mode option. Following you can find behavior differences which...

...sudo gem install rails -v=2.3.12. You will also need Ubuntu development packages for MySQL, RMagick, etc. The bundle install call will otherwise fail for such projects...

...foreign keys. They are dumped to schema.rb as well. At this time, only the mysql, mysql2 and postgresql adapters support foreign keys. @rubyonrails Workings add_foreign_key(:comments, :users)

In the tradition of our PostgreSQL cheat sheet for MySQL lamers, here is a cheat sheet for Jasmine when you're used to RSpec. Note that Jasmine syntax has changed...

...and need to be sanitized. Unfortunately this works in SQLite but does not in MySQL: named_scope :filter, lambda { |attribute, value| { :conditions => [ 'articles.? = ?', attribute, value ] } } The solution is to use...

This is an extension to PostgreSQL vs MySQL: How to UPDATE using a JOIN. UPDATE employees SET department_name = departments.name, department_area = areas.name FROM departments, areas WHERE employees.department_id = departments.id...