Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7760445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:53:25+00:00 2026-06-01T13:53:25+00:00

I noticed that Rails creates triggers in the development db but not the test

  • 0

I noticed that Rails creates triggers in the development db but not the test db since it creates the test db from schema.rb instead of running migrations. I have a trigger (as a migration) and need to test that it does the right thing, how can I do that? I tried adding the trigger manually to the test db but that didn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:53:26+00:00Added an answer on June 1, 2026 at 1:53 pm

    By default rails sets up the test database using the database independant schema.rb, which doesn’t understand stuff like triggers.

    If you change config.active_record_schema_format to :sql then rails will instead dump the raw SQL that represents the development database’s structure and use that to recreate the test database. This dump is placed in development.sql, which is then used instead of schema.rb

    This dump is done using the command line tools that your db provides and so will respect features like triggers that active record isn’t aware of

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed that the generic IEnumerator<T> inherits from IDisposable, but the non-generic interface IEnumerator
As I've been writing test suites for a Rails app, I've noticed that there
All of my rails 3.2.2 ActiveRecord methods are being executed twice. I noticed that
I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but
i noticed that paypal displays a very different favicon, one that's not just a
I'm just learning rails and have noticed that when I create an object that
I am running Ruby on Rails 3 and I have an application that makes
Help, I've broken my Rails3 user model! I first noticed that I could not
I'm seeing a strange error since I moved from Rails 3.0.11 to 3.1.3. Here's
I noticed that Google maps is providing directions in my local language (hungarian) when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.