Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove school address name from orders #42

Merged
merged 4 commits into from
Jan 7, 2025

Conversation

mhope21
Copy link
Collaborator

@mhope21 mhope21 commented Jan 5, 2025

Issue

Despite this migration #20241206222108:

class RemoveSchoolNameAndSchoolAddressFromOrders < ActiveRecord::Migration[7.2]
def change
change_table :orders do |t|
t.remove :school_name, :school_address
end
end
end

My database still contains these two columns.

Changes

  1. Create a new migration to remove these columns if they still exist.
  • Before:
    sqlite> PRAGMA table_info(orders);
    0|id|INTEGER|1||1
    1|school_year|varchar|0||0
    2|kit_id|INTEGER|1||0
    3|created_at|datetime(6)|1||0
    4|updated_at|datetime(6)|1||0
    5|phone|varchar|0||0
    6|school_name|varchar|0||0
    7|school_address|varchar|0||0
    8|comments|TEXT|0||0
    9|user_id|INTEGER|0||0
    10|address_id|INTEGER|0||0
  • After:
    == 20250105230503 RemoveSchoolAddressAndSchoolNameFromOrders: migrating =======
    -- change_table(:orders)
    -- column_exists?(:orders, :school_name)
    -> 0.0034s
    -- column_exists?(:orders, :school_address)
    -> 0.0007s
    -> 0.0637s
    == 20250105230503 RemoveSchoolAddressAndSchoolNameFromOrders: migrated (0.0638s)

sqlite> PRAGMA table_info(orders);
0|id|INTEGER|1||1
1|school_year|varchar|0||0
2|kit_id|INTEGER|1||0
3|created_at|datetime(6)|1||0
4|updated_at|datetime(6)|1||0
5|phone|varchar|0||0
6|comments|TEXT|0||0
7|user_id|INTEGER|0||0
8|address_id|INTEGER|0||0

Review Checklist

  • I have documented my code with code comments.

Copy link
Collaborator

@trca831 trca831 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mhope21 mhope21 merged commit 5e2852d into main Jan 7, 2025
3 checks passed
@mhope21 mhope21 deleted the Remove-school-address-name-from-orders branch January 7, 2025 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants