Skip to content

Commit

Permalink
mxq_group: add group_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mariux committed Jun 9, 2015
1 parent 95fe40c commit 2ee6185
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mxq_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
#include "mxq_mysql.h"
#include "mx_mysql.h"

#define GROUP_FIELDS_CNT 24
#define GROUP_FIELDS_CNT 25
#define GROUP_FIELDS \
" group_id," \
" group_name," \
" group_status," \
" group_flags," \
" group_priority," \
" user_uid," \
" user_name," \
Expand Down Expand Up @@ -101,6 +102,7 @@ static int bind_result_group_fields(struct mx_mysql_bind *result, struct mxq_gro
res += mx_mysql_bind_var(result, idx++, uint64, &(g->group_id));
res += mx_mysql_bind_var(result, idx++, string, &(g->group_name));
res += mx_mysql_bind_var(result, idx++, uint8, &(g->group_status));
res += mx_mysql_bind_var(result, idx++, uint64, &(g->group_flags));
res += mx_mysql_bind_var(result, idx++, uint16, &(g->group_priority));

res += mx_mysql_bind_var(result, idx++, uint32, &(g->user_uid));
Expand Down
1 change: 1 addition & 0 deletions mxq_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct mxq_group {
unsigned long _group_name_length;

uint8_t group_status;
uint64_t group_flags;
uint16_t group_priority;

uint32_t user_uid;
Expand Down
5 changes: 5 additions & 0 deletions mysql/create_tables
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

ALTER TABLE mxq_group
ADD COLUMN group_flags INT8 UNSIGNED NOT NULL DEFAULT 0
AFTER group_status;

ALTER TABLE mxq_group
ADD COLUMN group_jobs_inq INT8 UNSIGNED NOT NULL DEFAULT 0
AFTER group_jobs;
Expand Down Expand Up @@ -40,6 +44,7 @@ CREATE TABLE IF NOT EXISTS mxq_group (
group_id INT8 UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
group_name VARCHAR(511) NOT NULL DEFAULT 'default',
group_status INT1 UNSIGNED NOT NULL DEFAULT 0,
group_flags INT8 UNSIGNED NOT NULL DEFAULT 0,
group_priority INT2 UNSIGNED NOT NULL DEFAULT 127,

user_uid INT4 UNSIGNED NOT NULL,
Expand Down

0 comments on commit 2ee6185

Please sign in to comment.