Skip to content

Commit

Permalink
Merge pull request #1097 from Open-Earth-Foundation/nina/feat/ON-2797…
Browse files Browse the repository at this point in the history
…/invitesCRUD

feat: [ON-3245] [ON-3246] [ON-3296]
  • Loading branch information
thehighestprimenumber authored Feb 4, 2025
2 parents 5bbc503 + 4ab6b31 commit c433b97
Show file tree
Hide file tree
Showing 56 changed files with 1,924 additions and 1,586 deletions.
42 changes: 42 additions & 0 deletions app/migrations/20250128154456-cityInvite__alter_type_user_id.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"use strict";

/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
// Add a temporary column with UUID type
await queryInterface.addColumn("CityInvite", "user_id_temp", {
type: Sequelize.UUID,
allowNull: true,
});

// Copy data from user_id to user_id_temp
await queryInterface.sequelize.query(
'UPDATE "CityInvite" SET "user_id_temp" = "user_id"::uuid',
);

// Remove the old user_id column
await queryInterface.removeColumn("CityInvite", "user_id");

// Rename the temporary column to user_id
await queryInterface.renameColumn("CityInvite", "user_id_temp", "user_id");
},

async down(queryInterface, Sequelize) {
// Add a temporary column with STRING type
await queryInterface.addColumn("CityInvite", "user_id_temp", {
type: Sequelize.STRING,
allowNull: true,
});

// Copy data from user_id to user_id_temp
await queryInterface.sequelize.query(
'UPDATE "CityInvite" SET "user_id_temp" = "user_id"::text',
);

// Remove the old user_id column
await queryInterface.removeColumn("CityInvite", "user_id");

// Rename the temporary column to user_id
await queryInterface.renameColumn("CityInvite", "user_id_temp", "user_id");
},
};
170 changes: 96 additions & 74 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"react-intersection-observer": "^9.8.2",
"react-markdown": "^9.0.1",
"react-redux": "^9.1.2",
"react-table": "^7.8.0",
"redux-persist": "^6.0.0",
"remark-gfm": "^4.0.0",
"sequelize": "^6.37.3",
Expand All @@ -134,6 +135,7 @@
"@types/glob": "^8.1.0",
"@types/lodash.groupby": "^4.6.9",
"@types/lodash.sumby": "^4.6.9",
"@types/react-table": "^7.7.20",
"cypress": "^13.6.4",
"glob": "^11.0.0",
"jest": "^29.7.0",
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/create-admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import env from "@next/env";
import { randomUUID } from "node:crypto";
import { logger } from "@/services/logger";
import bcrypt from "bcrypt";
import { Roles } from "@/lib/auth";
import { Roles } from "@/util/types";

async function createAdmin() {
const projectDir = process.cwd();
Expand Down
Loading

0 comments on commit c433b97

Please sign in to comment.