Skip to content

Commit bddbbfb

Browse files
committed
Expand database schema for new features
1 parent 6b2db20 commit bddbbfb

File tree

5 files changed

+308
-122
lines changed

5 files changed

+308
-122
lines changed

Mms.Database/access_control.cs

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,57 @@ public partial class keycode
155155
[ExplicitColumns]
156156
public partial class member
157157
{
158+
[Column]
159+
public string address { get; set; }
160+
158161
[Column]
159162
public sbyte apricot_admin { get; set; }
160163

164+
[Column]
165+
public string area_funding_1 { get; set; }
166+
167+
[Column]
168+
public string area_funding_2 { get; set; }
169+
170+
[Column]
171+
public string area_funding_3 { get; set; }
172+
173+
[Column]
174+
public string area_funding_4 { get; set; }
175+
176+
[Column]
177+
public string area_funding_5 { get; set; }
178+
179+
[Column]
180+
public string email { get; set; }
181+
161182
[Column]
162183
public DateTime expires { get; set; }
163184

164185
[Column]
165186
public DateTime joined { get; set; }
166187

188+
[Column]
189+
public string last_paypal { get; set; }
190+
167191
[Column]
168192
public int member_id { get; set; }
169193

194+
[Column]
195+
public string mms_storage { get; set; }
196+
197+
[Column]
198+
public string mv_storage { get; set; }
199+
170200
[Column]
171201
public string name { get; set; }
172202

203+
[Column]
204+
public string phone { get; set; }
205+
206+
[Column]
207+
public int primary_family { get; set; }
208+
173209
[Column]
174210
public string type { get; set; }
175211

@@ -237,5 +273,39 @@ public partial class reader
237273

238274
}
239275

276+
[TableName("`access_control`.`session`")]
277+
[PrimaryKey("session_id", AutoIncrement=false)]
278+
[ExplicitColumns]
279+
public partial class session
280+
{
281+
[Column]
282+
public sbyte access_granted { get; set; }
283+
284+
[Column]
285+
public string action { get; set; }
286+
287+
[Column]
288+
public int duration { get; set; }
289+
290+
[Column]
291+
public string keycode { get; set; }
292+
293+
[Column]
294+
public int member_id { get; set; }
295+
296+
[Column]
297+
public int reader_id { get; set; }
298+
299+
[Column]
300+
public int session_id { get; set; }
301+
302+
[Column]
303+
public int start_attempt_id { get; set; }
304+
305+
[Column]
306+
public DateTime start_time { get; set; }
307+
308+
}
309+
240310
}
241311

Mms.Database/area_funding.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,34 @@ public partial class current
301301

302302
}
303303

304+
[TableName("`area_funding`.`donation`")]
305+
[PrimaryKey("donation_id", AutoIncrement=false)]
306+
[ExplicitColumns]
307+
public partial class donation
308+
{
309+
[Column]
310+
public decimal amount { get; set; }
311+
312+
[Column]
313+
public string area { get; set; }
314+
315+
[Column]
316+
public string comment { get; set; }
317+
318+
[Column]
319+
public DateTime donation_date { get; set; }
320+
321+
[Column]
322+
public long donation_id { get; set; }
323+
324+
[Column]
325+
public string paypal_account { get; set; }
326+
327+
[Column]
328+
public string type { get; set; }
329+
330+
}
331+
304332
[TableName("`area_funding`.`funds`")]
305333
[PrimaryKey("funds_id")]
306334
[ExplicitColumns]

SQL Scripts/access_control_schema.sql

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
SQLyog Community
3-
MySQL - 10.11.6-MariaDB-0+deb12u1-log : Database - access_control
3+
MySQL - 10.11.14-MariaDB-0+deb12u2-log : Database - access_control
44
*********************************************************************
55
*/
66

@@ -26,7 +26,7 @@ CREATE TABLE `attempt` (
2626
`action` varchar(255) NOT NULL DEFAULT '',
2727
`attempt_time` datetime /* mariadb-5.3 */ NOT NULL,
2828
PRIMARY KEY (`attempt_id`)
29-
) ENGINE=MyISAM AUTO_INCREMENT=1981581 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
29+
) ENGINE=MyISAM AUTO_INCREMENT=2878910 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3030

3131
/*Table structure for table `audit` */
3232

@@ -52,15 +52,15 @@ CREATE TABLE `charge` (
5252
`invoice_line_id` bigint(20) DEFAULT NULL,
5353
`updated_time` datetime NOT NULL,
5454
PRIMARY KEY (`charge_id`)
55-
) ENGINE=MyISAM AUTO_INCREMENT=434 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
55+
) ENGINE=MyISAM AUTO_INCREMENT=611 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5656

5757
/*Table structure for table `group` */
5858

5959
CREATE TABLE `group` (
6060
`group_id` int(11) NOT NULL AUTO_INCREMENT,
6161
`name` varchar(255) NOT NULL,
6262
PRIMARY KEY (`group_id`)
63-
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
63+
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
6464

6565
/*Table structure for table `group_member` */
6666

@@ -86,10 +86,22 @@ CREATE TABLE `member` (
8686
`member_id` int(11) NOT NULL,
8787
`name` varchar(255) NOT NULL,
8888
`type` varchar(255) NOT NULL,
89+
`primary_family` int(11) NOT NULL,
8990
`apricot_admin` tinyint(1) NOT NULL,
90-
`joined` datetime /* mariadb-5.3 */ NOT NULL,
91-
`expires` datetime /* mariadb-5.3 */ NOT NULL,
92-
`updated` datetime /* mariadb-5.3 */ NOT NULL,
91+
`joined` datetime NOT NULL,
92+
`expires` datetime NOT NULL,
93+
`email` varchar(255) NOT NULL,
94+
`phone` varchar(255) NOT NULL,
95+
`address` varchar(255) NOT NULL,
96+
`last_paypal` varchar(255) NOT NULL,
97+
`mms_storage` varchar(255) NOT NULL,
98+
`mv_storage` varchar(255) NOT NULL,
99+
`area_funding_1` varchar(255) NOT NULL,
100+
`area_funding_2` varchar(255) NOT NULL,
101+
`area_funding_3` varchar(255) NOT NULL,
102+
`area_funding_4` varchar(255) NOT NULL,
103+
`area_funding_5` varchar(255) NOT NULL,
104+
`updated` datetime NOT NULL,
93105
PRIMARY KEY (`member_id`)
94106
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
95107

@@ -120,6 +132,21 @@ CREATE TABLE `reader` (
120132
PRIMARY KEY (`reader_id`)
121133
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
122134

135+
/*Table structure for table `session` */
136+
137+
CREATE TABLE `session` (
138+
`session_id` int(11) NOT NULL,
139+
`start_attempt_id` int(11) NOT NULL,
140+
`keycode` varchar(255) NOT NULL,
141+
`member_id` int(11) NOT NULL,
142+
`reader_id` int(11) NOT NULL,
143+
`start_time` datetime NOT NULL,
144+
`duration` int(11) NOT NULL,
145+
`access_granted` tinyint(1) NOT NULL,
146+
`action` varchar(255) NOT NULL,
147+
PRIMARY KEY (`session_id`)
148+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
149+
123150
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
124151
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
125152
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

0 commit comments

Comments
 (0)