Skip to content

Ecobricks Table

GEA Admin edited this page Nov 17, 2024 · 2 revisions

tb_ecobricks

One of the most important tables in our GoBrik database and in the Brikchain is our ecobricks table. Here, the essential information of each ecobrick that is made is stored. The following is a breakdown of the fields and the views contained in this table.

Fields

Field Name Type Description
date_published_ts datetime The timestamp when the ecobrick was officially published or added to the system.
knack_record_id char(24) OBSOLETE! Legacy ecobrick ID identifier from the old Knack database. Most likely can be deleted (15/10/24).
maker_id char(24) OBSOLETE! Legacy unique identifier linking ecobrick records to makers. Replaced by ecobricker_id.
ecobrick_unique_id int(11) AUTO_INCREMENT primary key for the ecobrick, providing a unique identifier for each ecobrick.
serial_no varchar(10) Serial number assigned to the ecobrick for tracking. Currently matches unique_id.
owner varchar(50) Current owner of the ecobrick.
ecobricker_maker varchar(50) Name of the ecobricker who physically made the ecobrick.
status varchar(255) Current status of the ecobrick (e.g., validated, in progress, submitted).
ecobrick_thumb_photo_url varchar(255) URL of the thumbnail image for the ecobrick on GoBrik.com.
ecobrick_full_photo_url varchar(255) URL of the full-size image for the ecobrick on GoBrik.com.
selfie_thumb_url varchar(255) URL of the thumbnail selfie of the ecobricker with their ecobrick.
selfie_photo_url varchar(255) URL of the full-size selfie photo of the ecobricker with their ecobrick.
volume_ml int(11) Volume of the ecobrick in milliliters.
universal_volume_ml float Standardized volume of the ecobrick for consistent comparisons.
weight_g int(11) Weight of the ecobrick in grams.
density decimal(10,2) Density of the ecobrick (weight per volume).
date_logged_ts datetime Timestamp when the ecobrick was logged in the system.
CO2_kg decimal(10,2) Amount of CO2 sequestered by the ecobrick, in kilograms.
sequestration_type varchar(100) Type of ecobrick (e.g., regular, ocean, cigbrick).
last_validation_ts datetime Timestamp of the ecobrick's last validation.
validator_1 varchar(50) Name of the first validator who reviewed the ecobrick.
validator_2 varchar(50) Name of the second validator who reviewed the ecobrick.
validator_3 varchar(50) Name of the third validator who reviewed the ecobrick.
validation_score_avg decimal(10,2) Average validation score after review.
final_validation_score decimal(10,2) Final score after all validations.
vision varchar(1024) Vision recorded by the maker during logging.
last_ownership_change date Date of the last ownership transfer of the ecobrick.
non_registered_maker_name varchar(30) Name of the maker if not registered in the system (legacy).
actual_maker_name varchar(50) Actual name of the maker, if different from the registered user (legacy).
weight_authenticated_kg float Authenticated weight of the ecobrick in kilograms (set only for authenticated ecobricks).
location_country varchar(35) Country where the ecobrick was made or logged.
location_watershed varchar(100) Watershed region where the ecobrick was created.
location_region varchar(50) Region or state where the ecobrick was created (legacy).
location_city varchar(100) City where the ecobrick was created (legacy).
location_municipality varchar(60) Municipality where the ecobrick was created (legacy).
location_full varchar(254) Full location where the ecobrick was created.
community_name varchar(50) Name of the community or group involved in making the ecobrick.
brand_name varchar(30) Brand of bottle used for the ecobrick.
bottom_colour varchar(20) Color of the bottom of the ecobrick.
plastic_from varchar(30) Source of the plastic used in the ecobrick.
ecobrick_brk_display_value varchar(20) BRK value assigned to the ecobrick for display purposes.
ecobrick_dec_brk_val decimal(10,2) Precise BRK value of the ecobrick.
ecobrick_brk_amt float Total BRK amount assigned to the ecobrick.
photo_choice varchar(100) User's choice of photo type to log.
location_lat decimal(10,8) Latitude of the ecobrick's location.
location_long decimal(11,8) Longitude of the ecobrick's location.
project_id int(11) ID of the associated project.
training_id int(11) ID of the associated training event.
catalyst varchar(50) Catalyst for creating the ecobrick (legacy).
brik_notes varchar(255) Notes associated with the ecobrick.
community_id int(11) ID of the associated community.
country_id int(11) ID of the associated country.

Views

View Name Description
vw_brk_by_year Summarizes ecobrick data by year.
vw_brk_pool Shows a pool of ecobrick transactions.
vw_brk_tranid_asc Displays ecobrick transactions in ascending order by transaction ID.
vw_brk_tranid_desc Displays ecobrick transactions in descending order by transaction ID.
vw_brk_tran_ledgerid_asc Displays ecobrick transaction ledgers in ascending order by ledger ID.
vw_brk_tran_ledgerid_desc Displays ecobrick transaction ledgers in descending order by ledger ID.
vw_calc_weight_by_year Calculates total weight of ecobricks per year.
vw_cash_tran_asc Displays cash transactions in ascending order.
vw_cash_tran_desc Displays cash transactions in descending order.
vw_detail_sums_by_year Summarizes ecobrick and cash transaction data by year.
vw_ecobricks_count_by_year Summarizes total count of ecobricks produced each year.
vw_ecobricks_desc Lists ecobricks in descending order by creation/logging date.
vw_ecobrick_tran_desc Lists ecobrick transactions in descending order by transaction date.
vw_exp_by_year_category Displays expenditures by year and category.
vw_exp_cash_tran_desc Lists cash expenditure transactions in descending order.
vw_gallery_feed Provides a gallery feed of ecobricks for visual display.
vw_rev_by_year_category Displays revenues by year and category.

Nomenclature note

In the GoBrik table we write table names with tb_ at the start of the table name (using a plural noun i.e. ecobricks, ecobrickers, etc) if it is only used on GoBrik. On the buwana database we add the _tb at the end of the name (using a plural nound i.e. users, countries, watershed, etc.). On the GoBrik database, if a table is mirrored on Buwana, we name it the same as on the Buwana database (i.e. communities_tb, languages_tb, countries_tb etc.)

Clone this wiki locally