Skip to content

164 new admin user table migrations#176

Merged
SamNie2027 merged 5 commits intomainfrom
164-new-admin-user-table-migrations
Feb 19, 2026
Merged

164 new admin user table migrations#176
SamNie2027 merged 5 commits intomainfrom
164-new-admin-user-table-migrations

Conversation

@chnnick
Copy link
Copy Markdown

@chnnick chnnick commented Feb 16, 2026

ℹ️ Issue

Closes #164

📝 Description

Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.

Briefly list the changes made to the code:

  1. Created migrations for the newly updated user table
  2. Created migrations for the newly updated admin table
  3. Created seed script (put in txt file) for seeding user and admin tables

✔️ Verification

What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.

Tables before and after running migrations
Screenshot 2026-02-16 at 5 30 57 PM

New Users Table
Screenshot 2026-02-16 at 5 33 07 PM

New Admins Table
Screenshot 2026-02-16 at 5 33 02 PM

Seeded info:
<img width="568" height="176" alt="Screenshot 2026-02-16 at 6 23 08 PM" src="https://github.com/user-attachments/assets/61f061b7-8545-49f0-9873-de3c2ea1
Screenshot 2026-02-16 at 6 23 18 PM
862e" />

Reverting migration:
Screenshot 2026-02-16 at 6 40 44 PM

POST: ADMINS
Screenshot 2026-02-16 at 6 26 34 PM

GET: ADMINS
Screenshot 2026-02-16 at 6 30 15 PM

DELETE: ADMINS
Screenshot 2026-02-16 at 6 30 34 PM

Protected by Auth so I didn't test
GET: USERS
DELETE: USERS

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!

Had to deal with duplicate type/field errors. Future runs of this may have issues if the migrations have been partially run before running these two. If running into such errors, reset db, run all migrations, and reseed.

Also, I didn't test the Users routes because they are protected by auth. I believe I need to go into cognito to get required access tokens, however I need to do more research into how that's done.

Lastly, one needs to import UsersModule into the AppModule to run tests on Users in the future. I didn't include importing it in this ticket because I felt like it was out of scope.

@SamNie2027
Copy link
Copy Markdown
Collaborator

Since the point of doing these migrations is to give us the ability to test things e2e, I would fix that import issue so that our application is more robust

@SamNie2027
Copy link
Copy Markdown
Collaborator

Also, to tests the users for now just comment out the annotations that are creating auth protection.

@SamNie2027
Copy link
Copy Markdown
Collaborator

SamNie2027 commented Feb 17, 2026

If there are type/field errors that are happening with init, can you delete those lines in init? If it doesn't have to do with init though, that's okay.

@SamNie2027
Copy link
Copy Markdown
Collaborator

For the before and after running migrations can you specifically do this based off of wiping the database entirely? E.g. totally empty database then running migrations? I seem to have problems running them successfully and I'm approaching testing from a blank database.

Copy link
Copy Markdown
Collaborator

@SamNie2027 SamNie2027 left a comment

Choose a reason for hiding this comment

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

^

@chnnick
Copy link
Copy Markdown
Author

chnnick commented Feb 17, 2026

will get done asap!

…into 164-new-admin-user-table-migrations + Confirmation of working after dropping public schema in dev
@chnnick
Copy link
Copy Markdown
Author

chnnick commented Feb 19, 2026

Screenshot 2026-02-19 at 11 18 32 AM Screenshot 2026-02-19 at 11 18 29 AM

Works after dropping schema and recreating! (Starting fresh)

Maybe theres a better way to ensure the migrations run w/o resorting to restarting from scratch but this should work!

@SamNie2027
Copy link
Copy Markdown
Collaborator

LGTM!

@SamNie2027 SamNie2027 merged commit 73bcfbb into main Feb 19, 2026
4 checks passed
@SamNie2027 SamNie2027 deleted the 164-new-admin-user-table-migrations branch February 19, 2026 23:37
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.

Delete old init Migration and regenerate Migration with Admin, User + postman endpoint testing and seeding tests

2 participants