Browse Source

Merge branch 'v2-beta' into develop

upstream-develop
poeti8 1 year ago
parent
commit
dd703450ae
3 changed files with 10 additions and 2 deletions
  1. +1
    -1
      package-lock.json
  2. +1
    -1
      package.json
  3. +8
    -0
      server/models/visit.ts

+ 1
- 1
package-lock.json View File

@ -1,6 +1,6 @@
{
"name": "kutt",
"version": "2.0.0",
"version": "2.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {


+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{
"name": "kutt",
"version": "2.0.0",
"version": "2.0.1",
"description": "Modern URL shortener.",
"main": "./production-server/server.js",
"scripts": {


+ 8
- 0
server/models/visit.ts View File

@ -10,6 +10,7 @@ export async function createVisitTable(knex: Knex) {
.dateTime("created_at")
.notNullable()
.defaultTo(knex.fn.now());
table.dateTime("updated_at").defaultTo(knex.fn.now());
table
.integer("link_id")
.references("id")
@ -74,4 +75,11 @@ export async function createVisitTable(knex: Knex) {
.defaultTo(0);
});
}
const hasUpdatedAt = await knex.schema.hasColumn("visits", "updated_at");
if (!hasUpdatedAt) {
await knex.schema.alterTable("visits", table => {
table.dateTime("updated_at").defaultTo(knex.fn.now());
});
}
}

Loading…
Cancel
Save