Skip to content

Commit 85bf8d2

Browse files
authored
Merge pull request #25 from topcoder-platform/PM-5307_project-showcase-post-api
PM-5307, PM-5306 project showcase post api
2 parents cb30bcb + 048dd6a commit 85bf8d2

40 files changed

Lines changed: 3648 additions & 2 deletions

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ workflows:
6969
branches:
7070
only:
7171
- dev
72+
tags:
73+
only: /^dev-.*/
7274

7375
build-prod:
7476
jobs:

appStartUp.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,16 @@ set -eo pipefail
33

44
export DATABASE_URL=$(echo -e ${DATABASE_URL})
55

6+
# Set default schema to 'public' if not provided
7+
if [ -z "$POSTGRES_SCHEMA" ]; then
8+
echo "POSTGRES_SCHEMA not set, defaulting to 'public'"
9+
export POSTGRES_SCHEMA="public"
10+
else
11+
echo "Using PostgreSQL schema: $POSTGRES_SCHEMA"
12+
fi
13+
14+
echo "Database - running migrations."
15+
npx prisma migrate deploy
16+
617
# Start the app
718
exec node dist/src/main

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"test:e2e": "jest --config ./test/jest-e2e.json",
2121
"test:load": "jest --config ./test/jest-e2e.json --runInBand --testRegex \"test/load/performance.test.ts$\"",
2222
"test:deployment": "jest --config ./test/jest-e2e.json --runInBand test/deployment-validation.e2e-spec.ts",
23+
"deploy:dev": "BRANCH=$(git rev-parse --abbrev-ref HEAD) && TAG=\"dev-${BRANCH}\" && git tag -d \"$TAG\" 2>/dev/null; git push origin \":refs/tags/$TAG\" 2>/dev/null; git tag \"$TAG\" && git push origin \"$TAG\"",
2324
"postinstall": "npx prisma generate"
2425
},
2526
"dependencies": {

prisma/add_types.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,19 @@ BEGIN
214214
);
215215
END IF;
216216

217+
IF NOT EXISTS (
218+
SELECT 1
219+
FROM pg_type t
220+
JOIN pg_namespace n ON n.oid = t.typnamespace
221+
WHERE n.nspname = 'projects' AND t.typname = 'ProjectShowcasePostStatus'
222+
) THEN
223+
CREATE TYPE projects."ProjectShowcasePostStatus" AS ENUM (
224+
'DRAFT',
225+
'PUBLISHED',
226+
'ARCHIVED'
227+
);
228+
END IF;
229+
217230
IF NOT EXISTS (
218231
SELECT 1
219232
FROM pg_type t

0 commit comments

Comments
 (0)