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 8221455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:55:50+00:00 2026-06-07T13:55:50+00:00

I’m trying to get set up with Sequel in Ruby. I went to http://sequel.rubyforge.org/rdoc/files/doc/migration_rdoc.html

  • 0

I’m trying to get set up with Sequel in Ruby. I went to http://sequel.rubyforge.org/rdoc/files/doc/migration_rdoc.html and created my first migration. Then I got Postgres.app running as my server and did a createdb Qsario. The problem comes when I try to use my migration to create the database fields:

$sequel -E -m . postgres://localhost/Qsario
I, [2012-07-08T13:53:49.659795 #6258]  INFO -- : (0.000374s) SET standard_conforming_strings = ON
I, [2012-07-08T13:53:49.660113 #6258]  INFO -- : (0.000153s) SET client_min_messages = 'WARNING'
I, [2012-07-08T13:53:49.660359 #6258]  INFO -- : (0.000163s) SET DateStyle = 'ISO'
I, [2012-07-08T13:53:49.664679 #6258]  INFO -- : (0.000952s) SELECT NULL FROM "schema_info" LIMIT 1
I, [2012-07-08T13:53:49.665179 #6258]  INFO -- : (0.000214s) SELECT * FROM "schema_info" LIMIT 1
I, [2012-07-08T13:53:49.665544 #6258]  INFO -- : (0.000166s) SELECT 1 AS "one" FROM "schema_info" LIMIT 1
I, [2012-07-08T13:53:49.666100 #6258]  INFO -- : (0.000325s) SELECT COUNT(*) AS "count" FROM "schema_info" LIMIT 1
I, [2012-07-08T13:53:49.666461 #6258]  INFO -- : (0.000179s) SELECT "version" FROM "schema_info" LIMIT 1
Error: NoMethodError: undefined method `Migration' for Sequel:Module/Users/me/Projects/Qsario/db/migrate/001_create_user_and_file_tables.rb:3:in `<top (required)>'

Here’s what 001_create_user_and_file_tables.rb looks like:

Sequel.Migration do
  no_transaction

  change do
    create_table(:users) do
      primary_key :id
      String      :username, :unique=>true
      String      :email, :unique=>true
      String      :password_hash
      String      :password_salt
      DateTime    :joined_at, :null => false
      FalseClass  :banned, default=>false
      String      :role, default=>"user"
    end

    create_table(:files) do
      primary_key :id
      foreign_key :user_id, :users
      String      :filename, :null => false
      DateTime    :uploaded_at, :null => false
    end

    create_table(:users_files) do
      primary_key :id
      foreign_key :user_id, :users
      foreign_key :file_id, :files
    end
  end
end

Note that there is no Rakefile or anything like that yet because I’m still trying to get things set up. I am not using Rails. So that .rb file is the only thing in the directory.

  • 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-07T13:55:51+00:00Added an answer on June 7, 2026 at 1:55 pm

    Just for the record, here’s what the fixed migration looks like, with comments around the fixes/improvements in case anyone else makes the same mistake I did. mu is too short deserves all the credit for helping me fix it.

    Sequel.migration do  # Lowercase 'm' in migration
      # That no_transaction bit was totally unnecessary.
    
      change do
        create_table(:users) do
          primary_key :id
          String      :username,    :unique=>true
          String      :email,       :unique=>true
          String      :password_hash
          String      :password_salt
          DateTime    :joined_at,   :null => false
          FalseClass  :banned,      :default=>false  # default needs to be :default
          String      :role,        :default=>"user"
        end
    
        create_table(:files) do
          primary_key :id
          foreign_key :user_id, :users
          String      :filename,    :null => false
          DateTime    :uploaded_at, :null => false
        end
    
        # A nicer way to make the old :users_files table.
        create_join_table(:user_id => :users, :file_id => :files)
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have thousands of HTML files to process using Groovy/Java and I need to
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:

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.