relay requesting (and maybe verifying) to the user
This commit is contained in:
@@ -18,7 +18,7 @@ export function up(pgm) {
|
||||
password: {type: 'varchar(32)'}
|
||||
});
|
||||
|
||||
pgm.addColumn('captchas', {proxy_id: {type: 'integer', references: 'proxies(id)'}})
|
||||
pgm.addColumn('captchas', {proxy_id: {type: 'integer', references: 'proxies(id)'}});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
46
migrations/1745958234333_users.js
Normal file
46
migrations/1745958234333_users.js
Normal file
@@ -0,0 +1,46 @@
|
||||
export const shorthands = undefined;
|
||||
|
||||
/**
|
||||
* @param pgm {import('node-pg-migrate').MigrationBuilder}
|
||||
* @param run {() => void | undefined}
|
||||
* @returns {Promise<void> | void}
|
||||
*/
|
||||
export function up(pgm) {
|
||||
pgm.createTable('users', {
|
||||
id: 'id',
|
||||
username: {type:"varchar(32)", notNull: true},
|
||||
password: {type:"char(60)", notNull: true}
|
||||
})
|
||||
|
||||
pgm.addColumn('captchas', {
|
||||
submitter: {type: 'integer', references: 'users(id)'}
|
||||
});
|
||||
|
||||
pgm.dropType('protocol_type', {cascade: true});
|
||||
pgm.dropTable('proxies', {cascade: true});
|
||||
pgm.dropColumn('captchas', 'proxy_id', {cascade: true});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pgm {import('node-pg-migrate').MigrationBuilder}
|
||||
* @param run {() => void | undefined}
|
||||
* @returns {Promise<void> | void}
|
||||
*/
|
||||
export function down(pgm) {
|
||||
pgm.dropTable('users');
|
||||
pgm.dropColumn('captchas', 'submitter');
|
||||
|
||||
pgm.createType('protocol_type', ['http', 'https']);
|
||||
|
||||
pgm.createTable('proxies', {
|
||||
id: 'id',
|
||||
proto: {type: 'protocol_type', notNull: true},
|
||||
claimed: {type: 'boolean', default: false},
|
||||
host: {type: 'inet', notNull: true},
|
||||
port: {type: 'smallint', notNull: true},
|
||||
username: {type: 'varchar(16)'},
|
||||
password: {type: 'varchar(32)'}
|
||||
});
|
||||
|
||||
pgm.addColumn('captchas', {proxy_id: {type: 'integer', references: 'proxies(id)'}});
|
||||
}
|
||||
Reference in New Issue
Block a user