Sei sulla pagina 1di 8

Users

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


ID number for
user _id Varchar 5 00001-99999 Foreign key
the system user
System users
username Varchar 15 Not null
password
System users
user_fname Varchar 30 Not null
first name
30 System users
user_mname Varchar Nullable
middle name
30 System users
user_lname Varchar Not null
last name
100 System users
user_email Varchar Not null
email
Date the system
user_joindate Date Not null user was
registered
1 System users
user_status Tinyint 1/0 Not null
status
100 Remember token
remember_token Varchar Not null for signing in.
Laravels default.
Date the record
created_at Timestamp Nullable was created;
Laravels default
Date the record
updated_at Timestamp Nullable was updated;
Laravels default

Logins

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


ID number for
user _id Varchar 5 00001-99999 Foreign key
the system user
System users
password Varchar 191 Not null
password
Owners

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


Year-month-
owner count ID number for
owner_id Varchar 10 Primary key
(Ex., the terrace owner
2017040001)
Owners first
owner_fname Varchar 191 Not null
name
Owners middle
owner_mname Varchar 30 Nullable
name
Owners last
owner_lname Varchar 30 Not null
name

owner_address Varchar 100 Not null Owners address

Owners
owner_bday Date Not null
birthdate
Date of owner
owner_joindate Date Not null
registration
Date the record
created_at Timestamp Nullable was created;
Laravels default
Date the record
updated_at Timestamp Nullable was updated;
Laravels default

Owner_Terraces

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


Year-month-
owner count ID number for
owner_id Varchar 10 Foreign key
(Ex., the terrace owner
2017040001)
1- Owners first
terrace_id Integer 11 Foreign key
99,999,999,999 name
Terraces

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number of
terrace_id Integer 11 Primary key
99,999,999,999 terrace
Terraces area in
terrace_area Varchar 191 Not null
square meters
Terraces
terrace_location Varchar 191 Not null
location

Activities Table

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number for
activity_id Integer 11 Primary key
99,999,999,999 the activity type
Description of
activity_desc Varchar 191 Not null
the activity
Terrace_Activity_Mains

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number of
terrace_id Integer 11 Foreign key
99,999,999,999 terrace
ID number of
1-
terrace_activity_id Integer 11 Primary key terraces activity
99,999,999,999
batch
Status of the
terrace_activity_main_sta
Tinyint 1 1/0 Not null terraces activity
tus
cycle as a whole
Status of the
terraces activity
cycle as a whole.
Used to check if
the terrace
terrace_activity_current Tinyint 1 1/0 Not null
activity cycle is
the current
activity ongoing
for the specified
terrace.
Date the terraces
terrace_activity_date_crea
Date Not null activity cycle
ted
was created
Date the record
created_at Timestamp Nullable was created;
Laravels default
Date the record
updated_at Timestamp Nullable was updated;
Laravels default
Terrace_Activities

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number of
terrace_id Integer 11 Foreign key
99,999,999,999 terrace
1- ID number for
activity_id Integer 11 Foreign key
99,999,999,999 the activity type
ID number of
1-
terrace_activity_id Integer 11 Foreign key terraces activity
99,999,999,999
batch
terrace_activity_date_star Date the terraces
Date Nullable
ted activity started
terrace_activity_date_fini Date the terraces
Date Nullable
shed activity finished
Status of the
terrace_activity_status Tinyint 1 Not null terraces activity
started

Crops Table

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number for
crop_id Integer 11 Primary key
99,999,999,999 the crop type
Description of
the crop type
crop_desc Varchar 191 Not null
(ex., Rice / Other
Crops)

Crop_Varieties Table

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number for
crop_variety_id Integer 11 Primary key
99,999,999,999 the crop variety
Description of
the crop variety
crop_variety_desc Varchar 191 Not null (ex., Kamote,
Potatoes, Onions,
etc.)

Rice_Varieties Table

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number for
rice_variety_id Integer 11 Primary key
99,999,999,999 the rice variety
Description of
the rice variety
rice_variety_desc Varchar 191 Not null (ex., Black rice,
White rice,
Brown Rice, etc.)

Terrace_Crops

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number of
terrace_id Integer 11 Foreign key
99,999,999,999 terrace
ID number of
1-
terrace_activity_id Integer 11 Foreign key terraces activity
99,999,999,999
batch
ID number for
1-
terrace_crop_id Integer 11 Primary key the terraces
99,999,999,999
crop/ Counter
ID number for
the crop type
crop_id Varchar 191 Foreign key (ex., ID number
of Rice / Other
Crops)
ID number for
1-
terrace_crop_variety_id Integer 11 Foreign key the rice / crop
99,999,999,999
variety planted
Terrace_Plot_Statuses

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number of
terrace_plot_status_id Integer 11 Primary key
99,999,999,999 plot status
Description of
plot status (ex.,
terrace_plot_status_desc Varchar 191 Not null Damaged,
Abandoned,
Restored)

Terrace_Statuses

DATA FIELD
FIELD NAME RANGE CONSTRAINT DESCRIPTION
TYPE LENGTH

Id Integer Auto-increment Not null Counter


1- ID number of
terrace_id Integer 11 Foreign key
99,999,999,999 terrace
1- ID number of
terrace_plot_status_id Integer 11 Foreign key
99,999,999,999 plot status
Date the plot
terrace_plot_status_updat
Date Not null status was
e
updated
State record for
the terraces
status. Will be
updated when the
terrace_status_state Tinyint 1/0 Not null status (Restored,
Damaged, and
Abandoned) of
the terrace was
changed.
Date the record
created_at Timestamp Nullable was created;
Laravels default
Date the record
updated_at Timestamp Nullable was updated;
Laravels default