...nice way to write strings that span multiple lines. Note that this example uses MySQL. Refer to this card if you use PostgreSQL. If you need more than one JOIN...

...always use Time.current instead of Time.now, etc. Why? Because of the way Rails and MySQL deal with time zones you would need to take care to use Time.zone.now in projects...

api.rubyonrails.org

...support nested transaction, this behaviour will be simulated with Savepoints (this is done for MySQL and Postgres). If a custom transaction lives inside another transaction, which we can not control...

makandra dev
wiki.debian.org

...not found", "Can't open file or directory", ...) after configuration changes, e.g. when changing MySQL's data directory. Remember to have a look at AppArmor's daemon configuration (usually at...

...because those times will also be converted using to_s(:db) and sent to MySQL. The database itself does not care about the (longer) value and just stores the date...

Bundler::GemRequireError: There was an error while trying to load the gem 'mysql2'. Gem Load Error is: Incorrect MySQL client library version! This gem was compiled for 5.5.46 but the...

...libmysqlclient.so.20: cannot open shared object file: No such file or directory": gem pristine mysql2 gem pristine re-installs a gem (without re-downloading), re-compiling all native extensions in...

...AJAX request completes before launching the debugger. A starved server thread can cause unexpected MySQL deadlocks. E.g. your test triggers a server request, locks some rows (MySQL automatically locks rows...

...starves the server thread. If you now run a query on the locked table, MySQL will explode with a detected deadlock. Again you need to wait_until the AJAX request...

DevOps Curriculum

...Nummern und Protokolle der häufigsten Services auswendig: SSH, DNS, HTTP, HTTPS, SMTP, POP3, IMAP, MySQL, PostgreSQL, Redis Wie kann ich prüfen, ob ein Service erreichbar ist? Wie kann ich alle...

See also PostgreSQL: Difference between text and varchar columns Text column sizes in MySQL

...rake db:migrate" on an empty # database, we swallow such errors. end end For MySQL, rescue Mysql2::Error, ActiveRecord::StatementInvalid might be fitting...

This card compares patterns to store trees in a relation database like MySQL or PostgreSQL. Implementation examples are for the ActiveRecord ORM used with Ruby on Rails, but the techniques...

Tod is a gem for working with daytimes. That's a tuple of (hour, minute second) without a day, month...

PostgreSQL, unlike MySQL, treats strings as case sensitive in all circumstances. This includes comparison with = and LIKE collision detection in unique indexes Usually this is fine, but some strings (like...

...will make ActiveRecord join the notes and authors tables and the query will fail: Mysql::Error: Column 'created_at' in order clause is ambiguous Unless you have a test covering...

geekytidbits.com

...id: Post.distinct_on_user.pluck(:user_id)).order(...) Further ressources There are some good examples on the MySql documentation to produce queries with the same result in the article 5.6.4 The Rows Holding...

Das Standardtool für Monitoring auf AWS ist Cloudwatch. Du hast dir in den AWS Kapiteln Cloudwatch sicherlich schon grundsätzlich angesehen...

$ mariabackup --prepare --target-dir ./mariabackup $ mariabackup --move-back --target-dir ./mariabackup # chown -R mysql:mysql /var/lib/mysql/ # systemctl start mariadb

DevOps Curriculum

...Database Service (RDS) ist ein vollständig verwalteter Dienst, um unterschiedliche relationale Datenbanken wie z.B. MySQL, MariaDB, PostgreSQL oder Oracle zu betreiben. Dabei sind Replikation, Backups und Failover bereits gelöst.

Active Record's select method allows you to make use of the power of MySQL select statements. On the one hand it allows you to select specific fields. Post.select("content...

...allows you to include additional data in your models such as the results of MySQL functions. Those function resulst then are accessible like any other attribute of your model. Lets...

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.

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...

...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...

...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...