Skip to content

Commit 7652b44

Browse files
authored
Merge pull request #75 from csci312a-s23/deployment-updates
Deployment updates
2 parents b03f069 + c68559e commit 7652b44

File tree

6 files changed

+65
-4
lines changed

6 files changed

+65
-4
lines changed

.github/workflows/deploy.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Automatic Remote Deployment
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Prepare ssh keys
13+
uses: shimataro/[email protected]
14+
with:
15+
key: ${{ secrets.CSCI312DEV_KEY}}
16+
known_hosts: ${{ secrets.CSCI312DEV_KNOWN_HOSTS}}
17+
18+
- name: Checkout the Repo
19+
uses: actions/[email protected]
20+
with:
21+
ssh-key: ${{ secrets.CSCI312DEV_KEY}}
22+
fetch-depth: 0
23+
ref: main
24+
25+
- name: Push to csci312.dev
26+
run: |
27+
git config user.name github-actions
28+
git config user.email [email protected]
29+
git remote add deploy ssh://[email protected]:ellen
30+
git push deploy
31+
32+
33+

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Student Direct
22

3-
Student Direct is web application that allows optionally anonymous users to post and interact with comments regarding issues pertaining to college life. Students, faculty, and administrators can all participate. Student Direct provides students with a direct, effortless, and straightforward line of communciation to the people positioned to make real changes on campus that can genuinely improve student life.
3+
Student Direct is web application that allows optionally anonymous users to post and interact with comments regarding issues pertaining to college life. Students, faculty, and administrators can all participate. Student Direct provides students with a direct, effortless, and straightforward line of communication to the people positioned to make real changes on campus that can genuinely improve student life.
44

55
![workflow status](https://github.com/csci312a-s23/project-ellen/actions/workflows/node.js.yml/badge.svg)
6+
![workflow status](https://github.com/csci312a-s23/project-ellen/actions/workflows/deploy.yml/badge.svg)
67

7-
[Link to application](https://student-direct.fly.dev/)
8+
[Link to application](https://ellen.csci312.dev//)
89

910
## Running the Database
1011

ellen.db

4 KB
Binary file not shown.

knex/migrations/20230410011515_posts.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
exports.up = function (knex) {
66
return knex.schema.createTable("posts", (table) => {
77
table.increments("id").primary();
8-
table.uuid("posterID").references("id").inTable("users");
98
table.string("title");
109
table.text("content");
1110
table.string("category");

knex/migrations/20230410012228_comments.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
exports.up = function (knex) {
66
return knex.schema.createTable("comments", (table) => {
77
table.increments("id").primary();
8-
table.uuid("commenterID").references("id").inTable("users");
98
table.integer("postID").references("id").inTable("posts");
109
table.text("content");
1110
table.integer("likes");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* @param { import("knex").Knex } knex
3+
* @returns { Promise<void> }
4+
*/
5+
exports.up = function (knex) {
6+
// Add foreign keys to posts table and comments table
7+
return knex.schema
8+
.alterTable("posts", (table) => {
9+
table.uuid("posterID").references("id").inTable("users");
10+
})
11+
.alterTable("comments", (table) => {
12+
table.uuid("commenterID").references("id").inTable("users");
13+
});
14+
};
15+
16+
/**
17+
* @param { import("knex").Knex } knex
18+
* @returns { Promise<void> }
19+
*/
20+
exports.down = function (knex) {
21+
// Remove foreign keys from posts table and comments table
22+
return knex.schema
23+
.alterTable("posts", (table) => {
24+
table.dropForeign("posterID");
25+
})
26+
.alterTable("comments", (table) => {
27+
table.dropForeign("commenterID");
28+
});
29+
};

0 commit comments

Comments
 (0)