Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 4a4b41d

Browse files
committed
rename profile_id column to raspberry_id
1 parent f49f155 commit 4a4b41d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
DO $$
2+
BEGIN
3+
BEGIN
4+
ALTER TABLE sys_user RENAME COLUMN profile_id TO raspberry_id;
5+
EXCEPTION
6+
WHEN invalid_column_reference THEN RAISE NOTICE 'column profile_id not found.';
7+
END;
8+
END;
9+
$$

users.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = function (options) {
2424
seneca.add({role: plugin, cmd: 'register'}, cmd_register);
2525
seneca.add({role: plugin, cmd: 'promote'}, cmd_promote);
2626
seneca.add({role: plugin, cmd: 'get_users_by_emails'}, cmd_get_users_by_emails);
27-
seneca.add({role: plugin, cmd: 'get_user_by_profile_id'}, cmd_get_user_by_profile_id);
27+
seneca.add({role: plugin, cmd: 'get_user_by_raspberry_id'}, cmd_get_user_by_raspberry_id);
2828
seneca.add({role: plugin, cmd: 'update'}, cmd_update);
2929
seneca.add({role: plugin, cmd: 'get_init_user_types'}, cmd_get_init_user_types);
3030
seneca.add({role: plugin, cmd: 'is_champion'}, cmd_is_champion);
@@ -309,11 +309,11 @@ module.exports = function (options) {
309309
}
310310
}
311311

312-
function cmd_get_user_by_profile_id (args, done) {
312+
function cmd_get_user_by_raspberry_id (args, done) {
313313
var seneca = this;
314314
var query = {};
315315

316-
query.profileId = args.profileId;
316+
query.raspberryId = args.raspberryId;
317317
query.limit$ = query.limit$ ? query.limit$ : 1;
318318

319319
seneca.make(ENTITY_NS).list$(query, function (err, users) {

0 commit comments

Comments
 (0)