--- /dev/null
+import { Knex } from "knex";
+
+
+export async function up(knex: Knex): Promise<void> {
+ return knex.schema.createTable('auth', function(table) {
+ table.uuid('id').primary();
+ table.string('username').notNullable();
+ table.string('password').notNullable();
+ table.timestamp('create_date').defaultTo(knex.raw('NOW()'))
+ })
+ .alterTable('players', function(table) {
+ table.string('account_type').notNullable().defaultTo('session');
+ table.timestamp('create_date').defaultTo(knex.raw('NOW()'))
+ })
+}
+
+
+export async function down(knex: Knex): Promise<void> {
+ return knex.schema.dropTable('auth')
+ .alterTable('players', function(table) {
+ table.dropColumn('account_type')
+ table.dropColumn('create_date')
+ });
+}
+
$('.maxHp').html(maxHp(player.constitution, player.level).toString());
$('.expToLevel').html(expToLevel(player.level + 1).toString());
$('.gold').html(player.gold.toLocaleString());
+
}
socket.on('connect', () => {