Skip to content

Commit

Permalink
fix usernames (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-t-wang authored Oct 9, 2024
1 parent 7ed95de commit c1b7e8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions migrations/20241009032342_update_old_names_primary_key.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- Add migration script here
-- 1. Drop the primary key on id and remove the id column
ALTER TABLE old_names
DROP CONSTRAINT old_names_pkey, -- Drop the current primary key on id
DROP COLUMN id;

-- Remove the id column
-- 2. Add a new primary key on old_username
ALTER TABLE old_names ADD CONSTRAINT old_names_pkey PRIMARY KEY (old_username);
1 change: 0 additions & 1 deletion src/types/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ impl Name {
#[allow(dead_code)]
#[derive(Debug, FromRow, PgInsert)]
pub struct MovedRecord {
pub id: f64,
pub old_username: String,
pub new_username: String,
}

0 comments on commit c1b7e8b

Please sign in to comment.