This page is automatic generated.
This documentation is automatically generated by information from MySQL and the PHP code.
The documentation inform you as developer about the database structure and column meaning.
Additional for the development of new API or backend parts, the module table usage (extracted from PHP codebase)
below provides helpful information. The provided information may help to find already existing queries, gateways,
and/or the best location for a new query/function.
Stores filled pickup slots, describes by who fetches when, where and if confirmed, needed to generate statistics (count, but not weight).
- Have deleted entries from fs_foodsaver and fs_betrieb reappear.
- Hide deleted fs_betrieb on existing map
- Don't care about that in existing code. Used to show pickup history, but broken old entries seem fine.
- Document: Add to database as comment (1: Confirmed, 0: Not confirmed)
- Clarify: Why is this an integer and not a boolean?
Contains information about regurlary reoccuring pickup slots.
- Document: Add to database as column (Dow) comment: Day of week (1=Monday, 0=Sunday)
- Document: Add to database as column (Time) comment: When on the day the pickup is
- Document: Add to database as column (Fetcher) comment: Number of slots (>= 0, >= 1 enforced by frontend)
- Clarify: Where are additional single pickup slots are stored?
- Remove all non-existent references to fs_betrieb, add
ON DELETE CASCADE
.
- Add foreign key relationship to fs_betrieb Reasoning: The data only affects future pickups that will not occur in case a store is removed.
Column | Description | Type | properties |
betrieb_id | | unsigned int(10) | Primary Key, Weak-foreign key (fs_betrieb:id) |
dow | Day of week (1=Monday, 0=Sunday) | unsigned int(4) | Primary Key |
time | Time when on the day the pickup is | time=00:00:00 | Primary Key |
fetcher | Number of slots (> 0, limited by frontend currently 8) | unsigned int(4)=4 | |
Stores answers to quiz.
- Add foreign key relationship to fs_question as well as
ON DELETE CASCADE
. Reasoning: Answers to removed questions are not needed, existing quiz sessions get a copy in fs_quiz_session.quiz_result
.
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
question_id | | unsigned int(10) | foreign key (fs_question:id) |
text | | text(16777215) | Nullable |
explanation | | text(16777215) | |
right | | unsigned int(4) | Nullable |
User tokens for ICS/ICAL/WebCal access to calendar of future events/pickups.
- Remove tokens for not existing users
- add foreign key relationship to fs_foodsaver as well as
ON DELETE CASCADE
.
Column | Description | Type | properties |
foodsaver_id | Owner of the token and identifier for the calendar | unsigned int(10) | foreign key (fs_foodsaver:id) |
token | Access token, hex-number from openssl. | varchar(255) | |
Link table between applications (for groups) and the wallposts. Design broken: Links foodsaver ids to the wallposts, e.g. all applications a foodsaver does to somewhere
- Remove entries for non-existing users
- add
ON DELETE CASCADE
to fs_foodsaver.
- Remove entries for non-existing wallposts
- add
ON DELETE CASCADE
to fs_wallpost
- Reasoning: Applications texts for deleted users are not useful anymore
Lists all foodbaskets.
- Check code to never display foodbaskets from removed users except to admins.
- Clarify: Meaning of status == Basket::Status
- Clarify: Meaning of fs_id
- Clarify: Meaning of appost
- Clarify: Meaning of contact_type
- Clarify: Meaning of location_type
- Clarify: Meaning of weight unit
- Clarify: Meaning of picture
- Clarify: Meaning of time
- Clarify: Meaning of update
- Clarify: Meaning of until
- Clarify: Meaning of fetchtime
- Clarify: Owner of tel
- Clarify: Owner of handy
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
foodsaver_id | | unsigned int(10) | Weak-foreign key (fs_foodsaver:id) |
status | @Basket::Status | unsigned int(4) | Nullable |
time | Creation datetime | datetime | Nullable |
update | | datetime | Nullable |
until | Basket is present until datetime expires | datetime | |
fetchtime | | datetime | Nullable |
description | | text(16777215) | Nullable |
picture | | varchar(150) | Nullable |
tel | | varchar(50) | |
handy | | varchar(50) | |
contact_type | | varchar(20)=1 | |
location_type | Fix set to 0 | unsigned int(4) | Nullable |
weight | Smaller <0kg = 3kg | float | Nullable |
lat | Basket location latitude | float | |
lon | Basket location longitude | float | |
bezirk_id | | unsigned int(10) | Weak-foreign key (fs_bezirk:id) |
fs_id | | int(10) | |
appost | | int(4) | |
Lists foodbasket requests.
- Remove entries for non-existing users
- add
ON DELETE CASCADE
to fs_foodsaver.
- Remove entries for non-existing baskets
- add
ON DELETE CASCADE
to fs_basket.
- Reasoning: Requests for non existant users do not need to be kept, basket FK is purely defensive.
Combines foodbaskets with different types of food. Unused: Has to be entered but is never evaluated.
- remove in code (in future), leave database as is (for now)
Column | Description | Type | properties |
basket_id | | unsigned int(10) | Primary Key |
art_id | | unsigned int(10) | Primary Key |
See fs_basket_has_art
Column | Description | Type | properties |
basket_id | | unsigned int(10) | Primary Key |
types_id | | unsigned int(10) | Primary Key |
Stores arbitrary notifications
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
name | | varchar(50) | Nullable |
body | | varchar(50) | Nullable |
vars | | text(16777215) | Nullable |
attr | | varchar(500) | Nullable |
icon | | varchar(150) | Nullable |
identifier | | varchar(40) | Nullable |
time | | datetime | |
closeable | | unsigned int(4)=1 | |
expiration | | date | Nullable |
Stores stores.
- Conversation 108242 and 108243 missing (store 1, 2) (fixed, inserted)
- Link
bezirk_id
to fs_bezirk
- Care about kette_id, betrieb_kategorie_id (fixed with issue #862)
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
betrieb_status_id | | unsigned int(10) | |
bezirk_id | | unsigned int(10) | |
added | | date | |
plz | | varchar(5) | |
stadt | | varchar(50) | |
lat | | varchar(20) | Nullable |
lon | | varchar(20) | Nullable |
kette_id | | unsigned int(10) | Nullable |
betrieb_kategorie_id | | int(11) | Nullable |
name | | varchar(120) | Nullable |
str | | varchar(120) | Nullable |
hsnr | | varchar(20) | Nullable |
status_date | | date | Nullable |
status | | unsigned int(4) | Nullable |
ansprechpartner | | varchar(60) | Nullable |
telefon | | varchar(50) | Nullable |
fax | | varchar(50) | Nullable |
email | | varchar(60) | Nullable |
begin | | date | Nullable |
besonderheiten | | text(16777215) | Nullable |
public_info | | varchar(200) | Nullable |
public_time | | int(4) | |
ueberzeugungsarbeit | | int(4) | |
presse | | int(4) | |
sticker | | int(4) | |
abholmenge | | int(4) | |
team_status | 0 = Team Voll; 1 = Es werden noch Helfer gesucht; 2 = Es werden dringend Helfer gesucht | int(4)=1 | |
prefetchtime | | unsigned int(10)=1209600 | |
team_conversation_id | | unsigned int(10) | Nullable |
springer_conversation_id | | unsigned int(10) | Nullable |
deleted_at | | datetime | Nullable |
Column | Description | Type | properties |
betrieb_id | | unsigned int(10) | Primary Key |
lebensmittel_id | | unsigned int(10) | Primary Key |
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
name | | varchar(50) | Nullable |
Stores wallposts on stores (independent of wallpost system)
- Have deleted entries from fs_foodsaver and fs_betrieb reappear.
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
foodsaver_id | | unsigned int(10) | |
betrieb_id | | unsigned int(10) | |
milestone | | unsigned int(4) | |
text | | text(16777215) | Nullable |
zeit | | datetime | Nullable |
last | | int(4) | |
Defines foodsaver team embers with pickup store provided food and statistic.
- Have deleted entries from fs_foodsaver and fs_betrieb reappear.
- Clarify: Describe the meaning of APPLIED_FOR_TEAM and jumber
- Clarify: Could a managing/verantworktlicher can pick up from a store?
- Clarify: What are Biebs? StoreGateway::getBiebsForStore()
- Clarify: Why does the table contains a id, is the foodsaver_id and betrieb_id not unique enought
- Clarify: Why are stats directly part table?
- Clarify: Is it possible to be black listed for a store or a team?
Stores districts as well as workinggroups (differentiated by type column) (referred to as 'group' or 'district' in this document)
- Remove unused columns email_pass, conversation_id
- Clarify: Field description
- Clarify: Extract typs from
src\Modules\Core\DBConstants\Region\Type
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
parent_id | | unsigned int(11) | foreign key (fs_bezirk:id), Nullable |
has_children | | int(4) | |
type | | int(4)=1 | |
teaser | | text(16777215) | |
desc | | text(16777215) | |
photo | | varchar(200) | |
master | | unsigned int(10) | |
mailbox_id | | unsigned int(10) | |
name | | varchar(50) | Nullable |
email | | varchar(120) | |
email_pass | | varchar(50) | |
email_name | | varchar(100) | |
apply_type | | int(4)=2 | |
banana_count | | int(4) | |
fetch_count | | int(4) | |
week_num | | int(4) | |
report_num | | int(4) | |
stat_last_update | | datetime=current_timestamp() | |
stat_fetchweight | | unsigned decimal | |
stat_fetchcount | | unsigned int(10) | |
stat_postcount | | unsigned int(10) | |
stat_betriebcount | | unsigned int(7) | |
stat_korpcount | | unsigned int(7) | |
stat_botcount | | unsigned int(7) | |
stat_fscount | | unsigned int(7) | |
stat_fairteilercount | | unsigned int(7) | |
conversation_id | | unsigned int(10) | |
moderated | | int(4) | |
Forum: Relates threads to groups.
- remove broken entries
- add foreign key relationsips on fs_theme and fs_bezirk with
ON DELETE CASCADE
trigger.
- remove broken entries
- add foreign key relationships on fs_bezirk and fs_wallpost with
ON DELETE CASCADE
trigger.
Stores blog entries (there is a /news URL)
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
bezirk_id | | unsigned int(10) | |
foodsaver_id | | unsigned int(10) | |
active | | unsigned int(4) | |
name | | varchar(100) | Nullable |
teaser | | varchar(500) | Nullable |
body | | text(16777215) | Nullable |
time | | datetime | Nullable |
picture | | varchar(150) | |
Notes the ambassador/admin attribute on a group membership.
- remove broken entries
- add foreign key relationships on fs_bezirk and fs_foodsaver
'I know XY' connection/friendship relation.
- investigate, why there are lots of '0' entries remove broken entries
- add foreign key relationships on fs_foodsaver with
ON DELETE CASCADE
trigger
Stores email addresses gathered from incoming/outgoing emails that will be used for autocompletion.
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
name | | varchar(180) | Nullable |
email | | varchar(180) | Nullable |
'Mini-CMS' content table that is used to generate some pages as well as sections on some pages.
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
name | | varchar(20) | Nullable |
title | | varchar(120) | Nullable |
body | | text(16777215) | Nullable |
last_mod | | datetime | Nullable |
Conversation table
- get rid of API module
- switch over to foodsharing-API backend to get rid of denormalized columns.
- By that, also stop htmlentities encoding. On the decoding side, implement time aware message body decoders.
- Denormalized fields usage: listConversations (member, last)
- remove last_foodsaver_id (unused, easy)
- remove heartbeat code (that is not used since we have socket.io)
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
locked | | int(1) | |
name | | varchar(40) | Nullable |
last | | datetime | Nullable |
last_foodsaver_id | | unsigned int(10) | Nullable |
last_message_id | | unsigned int(10) | Nullable |
last_message | | text(16777215) | Nullable |
last_message_is_htmlentity_encoded | | int(1)=1 | |
Contains email addresses that are not allowed to signup (needs database admin to maintain)
Column | Description | Type | properties |
email | | varchar(255) | |
since | | timestamp=current_timestamp() | |
reason | | text(16777215) | |
Column | Description | Type | properties |
email | | varchar(255) | |
bounced_at | | datetime | |
bounce_category | | varchar(255) | |
Mass mailer status table (per-recipient status)
- remove broken entries
- add foreign key relationships to fs_foodsaver and fs_email with
ON DELETE CASCADE
Contains all events
- Regain missing users
- Check code fetching events to properly handle deleted users
- remove broken entries for fs_bezirk by setting them NULL
- add foreign key relationship to fs_bezirk (on delete set NULL)
- add foreign key relationship to fs_location (nullable)
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
foodsaver_id | | unsigned int(10) | |
bezirk_id | | unsigned int(10) | foreign key (fs_bezirk:id), Nullable |
location_id | | unsigned int(10) | foreign key (fs_location:id), Nullable |
public | | int(1) | |
name | | varchar(200) | Nullable |
start | | datetime | |
end | | datetime | |
description | | text(16777215) | Nullable |
bot | | unsigned int(4) | Nullable |
online | | unsigned int(4) | Nullable |
Links wallposts on event (only communication channel for an event)
- Remove broken entries
- add foreign key relationships to fs_event and fs_wallpost,
ON DELETE CASCADE
Lists fair share points
- Null broken entries (should still be listable in map)
- add foreign key relationship to fs_bezirk
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
bezirk_id | | unsigned int(10) | foreign key (fs_bezirk:id), Nullable |
name | | varchar(260) | Nullable |
picture | | varchar(100) | |
status | | unsigned int(4) | Nullable |
desc | | text(16777215) | Nullable |
anschrift | | varchar(260) | Nullable |
plz | | varchar(5) | Nullable |
ort | | varchar(100) | Nullable |
lat | | varchar(100) | Nullable |
lon | | varchar(100) | Nullable |
add_date | | date | Nullable |
add_foodsaver | | unsigned int(10) | Nullable |
Links follower/responsible to food share points
- Remove broken entries
- add foreign key relationships to fs_foodsaver and fs_fairteiler with
ON DELETE CASCADE
Links wallposts to fair share points
- Remove broken entries
- add foreign key relationship to fs_fairteiler, fs_wallpost with
ON DELETE CASCADE
- check code that handles wallpost display to see how NULL foodsavers are handled.
- Reasoning: Keep wallposts from deleted users.
Stores non-recurring pickup slots (just the slot, no fetcher information)
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
betrieb_id | | unsigned int(10) | |
time | | datetime | Nullable |
fetchercount | | unsigned int(4) | Nullable |
Column | Description | Type | properties |
id | | int(11) | Primary Key |
weight | | decimal | |
User
- add deleted_at column
- bezirk_id ('home district') is 0 for a lot of users. Should be NULL. As we don't need this soon in new backend, care later.
- Document: Add to database as column (deleted_at) comment:
deleted_at
: deletion day of account, if NULL
, account is active
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
bezirk_id | | unsigned int(10) | |
position | | varchar(255) | |
verified | | unsigned int(4) | |
last_pass | | datetime | Nullable |
new_bezirk | | varchar(120) | |
want_new | | int(4) | |
mailbox_id | | unsigned int(10) | Nullable |
rolle | | int(4) | |
type | | int(4) | Nullable |
plz | | varchar(10) | Nullable |
stadt | | varchar(100) | Nullable |
lat | | varchar(20) | Nullable |
lon | | varchar(20) | Nullable |
photo | | varchar(50) | Nullable |
email | | varchar(120) | Nullable |
password | | varchar(100) | Nullable |
name | | varchar(120) | Nullable |
admin | | unsigned int(4) | Nullable |
nachname | | varchar(120) | Nullable |
anschrift | | varchar(120) | Nullable |
telefon | | varchar(30) | Nullable |
homepage | | varchar(255) | Nullable |
handy | | varchar(50) | Nullable |
geschlecht | | unsigned int(4) | |
geb_datum | | date | Nullable |
anmeldedatum | | datetime | Nullable |
privacy_notice_accepted_date | | datetime | Nullable |
privacy_policy_accepted_date | | datetime | Nullable |
orgateam | | unsigned int(4) | Nullable |
active | | unsigned int(4) | |
data | | text(16777215) | |
about_me_public | | text(16777215) | |
newsletter | | int(1) | |
token | | varchar(100) | |
infomail_message | | int(1) | Nullable |
last_login | | datetime | Nullable |
stat_fetchweight | | unsigned decimal | |
stat_fetchcount | | unsigned int(10) | |
stat_ratecount | | unsigned int(10) | |
stat_rating | | unsigned decimal | |
stat_postcount | | int(11) | |
stat_buddycount | | unsigned int(7) | |
stat_bananacount | | unsigned int(7) | |
stat_fetchrate | | decimal=100 | |
sleep_status | | unsigned int(4) | |
sleep_from | | date | Nullable |
sleep_until | | date | Nullable |
sleep_msg | | text(16777215) | Nullable |
option | | text(16777215) | |
beta | | int(1) | |
quiz_rolle | | unsigned int(4) | |
contact_public | | int(4) | |
deleted_at | | datetime | Nullable |
about_me_intern | | text(65535) | Nullable |
deleted_by | id of the user who deleted this profile | unsigned int(10) | Nullable |
deleted_reason | optional explanation why this profile was deleted | varchar(200) | Nullable |
Archive table to hold removed users for admin purposes
- Move to fs_foodsaver_archive3
- Recreate with same structure as fs_foodsaver
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
bezirk_id | | unsigned int(10) | |
position | | varchar(255) | |
verified | | unsigned int(4) | |
last_pass | | datetime | Nullable |
new_bezirk | | varchar(120) | |
want_new | | int(4) | |
mailbox_id | | unsigned int(10) | Nullable |
rolle | | int(4) | |
type | | int(4) | Nullable |
plz | | varchar(10) | Nullable |
stadt | | varchar(100) | Nullable |
lat | | varchar(20) | Nullable |
lon | | varchar(20) | Nullable |
photo | | varchar(50) | Nullable |
email | | varchar(120) | Nullable |
password | | varchar(100) | Nullable |
name | | varchar(120) | Nullable |
admin | | unsigned int(4) | Nullable |
nachname | | varchar(120) | Nullable |
anschrift | | varchar(120) | Nullable |
telefon | | varchar(30) | Nullable |
homepage | | varchar(255) | Nullable |
handy | | varchar(50) | Nullable |
geschlecht | | unsigned int(4) | |
geb_datum | | date | Nullable |
anmeldedatum | | datetime | Nullable |
privacy_notice_accepted_date | | datetime | Nullable |
privacy_policy_accepted_date | | datetime | Nullable |
orgateam | | unsigned int(4) | Nullable |
active | | unsigned int(4) | |
data | | text(16777215) | |
about_me_public | | text(16777215) | |
newsletter | | int(1) | |
token | | varchar(25) | |
infomail_message | | int(1) | Nullable |
last_login | | datetime | Nullable |
stat_fetchweight | | unsigned decimal | |
stat_fetchcount | | unsigned int(10) | |
stat_ratecount | | unsigned int(10) | |
stat_rating | | unsigned decimal | |
stat_postcount | | int(11) | |
stat_buddycount | | unsigned int(7) | |
stat_bananacount | | unsigned int(7) | |
stat_fetchrate | | decimal=100 | |
sleep_status | | unsigned int(4) | |
sleep_from | | date | Nullable |
sleep_until | | date | Nullable |
sleep_msg | | text(16777215) | Nullable |
option | | text(16777215) | |
beta | | int(1) | |
quiz_rolle | | unsigned int(4) | |
contact_public | | int(4) | |
deleted_at | | datetime | Nullable |
about_me_intern | | text(65535) | Nullable |
deleted_by | id of the user who deleted this profile | unsigned int(10) | Nullable |
deleted_reason | optional explanation why this profile was deleted | varchar(200) | Nullable |
Logs all changes to personal data in foodsaver table
- Do not use indices as this should persist deletions (as one reason for it was to be able to detect abuse)
Column | Description | Type | properties |
date | | timestamp=current_timestamp() | |
fs_id | | int(11) | |
changer_id | | int(11) | |
object_name | | text(16777215) | |
old_value | | text(16777215) | Nullable |
new_value | | text(16777215) | Nullable |
Stores bell <-> user relationship
- Remove broken data
- Add foreign key relationships to fs_foodsaver and fs_bell
Describes which foodsaver is in which group/district/workgroups and regions membership
- Remove broken data
- Add foreign key relationships to fs_foodsaver and fs_bezirk
Column | Description | Type | properties |
foodsaver_id | | unsigned int(10) | Primary Key, foreign key (fs_foodsaver:id) |
bezirk_id | | unsigned int(10) | Primary Key, foreign key (fs_bezirk:id) |
active | 0=beworben,1=aktiv,10=vielleicht | unsigned int(10) | Nullable |
added | | datetime=current_timestamp() | |
application | | text(16777215) | |
Relates contacts (email addresses, see above) to users
- Remove broken data
- Add FK to fs_foodsaver, fs_contact
Relates conversations to foodsavers. Care: It is also used to look up conversations by user
- Reinsert missing foodsaver, add FK to fs_conversation (not to user)
- Fix code to handle deleted users correctly
Relates users to events.
- Remove broken data
- FK on fs_foodsaver, fs_event,
ON DELETE CASCADE
Column | Description | Type | properties |
foodsaver_id | | unsigned int(10) | Primary Key, foreign key (fs_foodsaver:id) |
option_type | category of the option | unsigned int(10) | Primary Key |
option_value | value of the option | varchar(255) | |
Column | Description | Type | properties |
foodsaver_id | id of the voter | unsigned int(10) | Primary Key, foreign key (fs_foodsaver:id) |
poll_id | id of the poll | unsigned int(10) | Primary Key, foreign key (fs_poll:id) |
time | time at which the voter has voted, null if not voted yet | datetime | Nullable |
Wallposts on user profile
- Remove broken data
- FK on fs_foodsaver, fs_wallpost,
ON DELETE CASCADE
Column | Description | Type | properties |
ip | | varchar(20) | Primary Key |
context | | varchar(10) | Primary Key |
start | | datetime | Nullable |
duration | | unsigned int(10) | Nullable |
Store chains
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
name | | varchar(60) | Nullable |
logo | | varchar(30) | |
Store different kinds of food to be linked with individual stores. Only ever implemented as setter, don't care for now.
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
name | | varchar(50) | Nullable |
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
name | | varchar(200) | Nullable |
lat | | decimal | Nullable |
lon | | decimal | Nullable |
zip | | varchar(10) | Nullable |
city | | varchar(100) | Nullable |
street | | varchar(200) | Nullable |
Stores mailbox names (for email mailboxes)
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
name | | varchar(50) | Nullable |
member | | int(4) | |
last_access | | datetime=current_timestamp() | |
Maps additional mailbox access for users (e.g. granting custom mailboxes or group ones)
- Remove brokendata
- FK on fs_mailbox, fs_mailbox_member,
ON DELETE CASCADE
emails
- remove brokendata
- FK on fs_mailbox,
ON DELETE CASCADE
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
mailbox_id | | unsigned int(10) | foreign key (fs_mailbox:id) |
folder | | unsigned int(4)=1 | Nullable |
sender | | text(65535) | Nullable |
to | | text(16777215) | |
subject | | text(65535) | Nullable |
body | | text(16777215) | Nullable |
body_html | | text(16777215) | |
time | | datetime | Nullable |
attach | | text(16777215) | Nullable |
read | | unsigned int(4) | Nullable |
answer | | unsigned int(4) | Nullable |
Requests to change the emailaddress
- Remove broken / old data
- FK on fs_foodsaver,
ON DELETE CASCADE
- There is a recent entry with foodsaver_id = 0. How did that get here?
Column | Description | Type | properties |
foodsaver_id | | unsigned int(10) | Primary Key, foreign key (fs_foodsaver:id) |
newmail | | varchar(200) | Nullable |
time | | datetime | Nullable |
token | | varchar(300) | Nullable |
Conversation messages
- Remove broken data (conversations), readd missing users
- FK on fs_conversation,
ON DELETE CASCADE
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
conversation_id | | unsigned int(10) | foreign key (fs_conversation:id) |
foodsaver_id | | unsigned int(10) | |
body | | text(16777215) | Nullable |
time | | datetime | Nullable |
is_htmlentity_encoded | | int(1)=1 | |
Logs which ID cards have been generated
- remove broken data (foodsaver_id), readd missing (bot_id)
- FK for foodsaver_id,
ON DELETE CASCADE
- handle emtpy users correctly (bot_id)
Password change/forgot requestsRelates questions <-> quiz
- remove broken/old data
- FK for foodsaver_id,
ON DELETE CASCADE
Column | Description | Type | properties |
foodsaver_id | | unsigned int(10) | Primary Key, foreign key (fs_foodsaver:id) |
name | | varchar(50) | Nullable |
time | | datetime | Nullable |
Column | Description | Type | properties |
id | unique id of the poll | unsigned int(10) | Primary Key, Auto-Increment |
region_id | region with which the poll is associated | unsigned int(10) | foreign key (fs_bezirk:id) |
name | title of the poll | varchar(200) | Nullable |
description | description of the poll | text(16777215) | Nullable |
scope | determines who will be invited to vote | unsigned int(2) | |
type | determines how a vote is cast and which values are possible for each option | unsigned int(2) | |
start | start timestamp for the poll | datetime | |
end | end timestamp for the poll | datetime | |
author | id of the user who created the poll | unsigned int(10) | |
creation_timestamp | | datetime | |
votes | number of users who have voted | unsigned int(10) | |
cancelled_by | id of the user who cancelled the poll | unsigned int(10) | Nullable |
eligible_votes_count | number of users who are eligible to vote | unsigned int(10) | |
shuffle_options | | int(4)=1 | |
Column | Description | Type | properties |
poll_id | the poll to which this option belongs | unsigned int(10) | Primary Key, foreign key (fs_poll:id) |
option | index of the option | unsigned int(2) | Primary Key |
option_text | description text of the option | varchar(200) | Nullable |
Column | Description | Type | properties |
poll_id | the poll to which the option belongs | unsigned int(10) | Primary Key, foreign key (fs_poll:id) |
option | index of the option | unsigned int(2) | Primary Key |
value | value for the option | int(2) | Primary Key |
votes | number of current votes for the value | unsigned int(10) | |
Column | Description | Type | properties |
id | | int(11) | Primary Key, Auto-Increment |
foodsaver_id | | int(11) | |
data | | text(65535) | Nullable |
type | | varchar(24) | Nullable |
Questions (for quiz)
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
text | | text(16777215) | Nullable |
duration | | unsigned int(3) | |
wikilink | | varchar(250) | |
Relates questions <-> quiz
- remove broken data
- FK to fs_quiz, fs_question,
ON DELETE CASCADE
Relates wallposts to questions
- remove broken data
- FK to fs_question, fs_wallpost,
ON DELETE CASCADE
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
name | | varchar(200) | Nullable |
desc | | text(16777215) | Nullable |
maxfp | | unsigned int(6) | |
questcount | | unsigned int(6) | |
Each try (by users) of a quiz (session)
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
foodsaver_id | | unsigned int(10) | foreign key (fs_foodsaver:id) |
quiz_id | | unsigned int(10) | |
status | | unsigned int(4) | Nullable |
quiz_index | | unsigned int(4) | Nullable |
quiz_questions | | text(16777215) | Nullable |
quiz_result | | text(16777215) | Nullable |
time_start | | datetime | Nullable |
time_end | | datetime | Nullable |
fp | | decimal | Nullable |
maxfp | | unsigned int(4) | Nullable |
quest_count | | unsigned int(4) | Nullable |
easymode | | int(4) | |
Stores trust bananas
- remove broken data (as we don't want to have trust bananas from/for deleted users)
- Add FK
Column | Description | Type | properties |
id | | int(11) | Primary Key, Auto-Increment |
region_id | | unsigned int(11) | foreign key (fs_bezirk:id) |
function_id | | unsigned int(11) | |
target_id | | int(11) | Nullable |
Column | Description | Type | properties |
region_id | | unsigned int(10) | Primary Key, foreign key (fs_bezirk:id) |
option_type | category of the option | unsigned int(10) | Primary Key |
option_value | value of the option | varchar(255) | |
Column | Description | Type | properties |
region_id | region id | unsigned int(10) | Primary Key, foreign key (fs_bezirk:id) |
lat | latitude | varchar(20) | |
lon | longitude | varchar(20) | |
desc | description | text(16777215) | |
status | state of the pin | unsigned int(4) | |
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
foodsaver_id | | unsigned int(10) | |
reporter_id | | unsigned int(10) | Nullable |
reporttype | | unsigned int(4) | Nullable |
betrieb_id | | unsigned int(10) | Nullable |
time | | datetime | Nullable |
committed | | unsigned int(4) | Nullable |
msg | | text(16777215) | Nullable |
tvalue | | varchar(300) | Nullable |
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
foodsaver_id | | unsigned int(10) | |
mailbox_id | | unsigned int(10) | |
mode | | int(4)=1 | |
complete | | int(4) | |
name | | varchar(200) | Nullable |
message | | text(16777215) | Nullable |
zeit | | datetime | Nullable |
recip | | text(16777215) | Nullable |
attach | | varchar(500) | |
Stores statistics per store (maybe broken implementation?)
Column | Description | Type | properties |
betrieb_id | | unsigned int(10) | Primary Key |
date | | datetime | Primary Key |
abholmenge | | decimal | |
Column | Description | Type | properties |
id | | int(11) | Primary Key, Auto-Increment |
store_id | ID of Store | int(10) | |
date_activity | when did the action take place | datetime=current_timestamp() | |
action | action type that was performed | int(4) | |
fs_id_a | foodsaver_id who is doing the action | int(10) | |
fs_id_p | to which foodsaver_id is it done to | int(10) | Nullable |
date_reference | date referenced (slot or wallpost entry) | datetime | Nullable |
content | Text from the store-wall-entry | varchar(255) | Nullable |
reason | Why a negativ action was done | varchar(255) | Nullable |
Threads in the forum.
- nothing as threads from deleted users should be kept
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
foodsaver_id | | unsigned int(10) | |
last_post_id | | unsigned int(10) | |
name | | varchar(260) | Nullable |
time | | datetime | Nullable |
active | | unsigned int(4)=1 | |
sticky | | int(1) | |
status | status of the thread (open or closed) | unsigned int(10) | |
stores who follows themes
- remove broken data (as follower information is irrelevant for broken XY)
- Add FK
Stores posts in themes
- Recreate users
- Remove broken data (for themes, not users)
- Add FK to themes
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
theme_id | | unsigned int(10) | foreign key (fs_theme:id) |
foodsaver_id | | unsigned int(10) | |
reply_post | | unsigned int(10) | |
body | | text(16777215) | Nullable |
time | | datetime | Nullable |
connects organotes on users with wallposts
- recreate missing users
- remove broken entries (for wallposts)
Column | Description | Type | properties |
usernotes_id | | unsigned int(10) | Primary Key |
wallpost_id | | unsigned int(10) | Primary Key, foreign key (fs_wallpost:id) |
usercomment | | int(4) | |
Column | Description | Type | properties |
fs_id | | unsigned int(10) | Nullable |
date | | datetime | |
bot_id | | unsigned int(10) | Nullable |
change_status | | int(1) | Nullable |
Column | Description | Type | properties |
id | | unsigned int(10) | Primary Key, Auto-Increment |
foodsaver_id | | unsigned int(10) | |
body | | text(16777215) | Nullable |
time | | datetime | Nullable |
attach | | text(16777215) | Nullable |
Column | Description | Type | properties |
version | | int(20) | Primary Key |
migration_name | | varchar(100) | Nullable |
start_time | | timestamp | Nullable |
end_time | | timestamp | Nullable |
breakpoint | | int(1) | |
Column | Description | Type | properties |
uuid | | char(36) | Primary Key |
user_id | | unsigned int(10) | |
sha256hash | | char(64) | |
mimeType | | varchar(255) | |
uploaded_at | | datetime | |
lastaccess_at | | datetime | |
filesize | | unsigned int(10) | |

























- fs_abholer (SELECT)
- fs_betrieb (SELECT)
- fs_bezirk (INSERT, SELECT, UPDATE)
- fs_bezirk_closure (INSERT, SELECT)
- fs_bezirk_has_theme (INSERT, SELECT)
- fs_botschafter (DELETE, INSERT, SELECT)
- fs_foodsaver (SELECT)
- fs_foodsaver_has_bezirk (INSERT, SELECT)
- fs_region_options (INSERT, SELECT)
- fs_region_pin (INSERT, SELECT)
- fs_theme (DELETE, INSERT, SELECT, UPDATE)
- fs_theme_follower (DELETE, INSERT, SELECT)
- fs_theme_post (DELETE, SELECT)






- fs_abholer (DELETE, INSERT, SELECT)
- fs_abholzeiten (SELECT)
- fs_betrieb (, INSERT, SELECT, UPDATE)
- fs_betrieb_has_lebensmittel (DELETE, INSERT, SELECT)
- fs_betrieb_kategorie (SELECT)
- fs_betrieb_notiz (DELETE, INSERT, SELECT)
- fs_betrieb_team (DELETE, INSERT, SELECT, UPDATE)
- fs_bezirk (SELECT)
- fs_bezirk_closure (SELECT)
- fs_fetchdate (INSERT, SELECT)
- fs_foodsaver (SELECT)
- fs_kette (SELECT)
- fs_lebensmittel (SELECT)
- fs_store_log (INSERT)

- fs_bezirk (SELECT)
- fs_bezirk_closure (SELECT)
- fs_botschafter (SELECT)
- fs_foodsaver (SELECT)
- fs_foodsaver_has_bezirk (SELECT)
- fs_foodsaver_has_poll (INSERT, SELECT, UPDATE)
- fs_poll (DELETE, INSERT, SELECT, UPDATE)
- fs_poll_has_option (SELECT)
- fs_poll_has_options (DELETE, INSERT, SELECT)
- fs_poll_option_has_value (DELETE, INSERT, SELECT, UPDATE)

