Block Instances Table Schema (block_instances)


Description

This table stores block instances. The type of block this is is given by the blockname column. The places this block instance appears is controlled by the parentcontexid, showinsubcontexts, pagetypepattern and subpagepattern fields. Where the block appears on the page (by default) is controlled by the defaultposition and defaultweight columns. The block's own configuration is stored serialized in configdata.

block_instances table columns

Column Type Size Nulls Auto Default Children Parents Comments
id BIGINT 19 null
block_positions.blockinstanceid blocposi_blo2_fk R
block_zoola_reports.blockinstanceid bloczoolrepo_blo2_fk R
block_zoola_reports_cohort.blockinstanceid bloczoolrepocoho_blo2_fk R
block_zoola_reports_user.blockinstanceid bloczoolrepouser_blo2_fk R
blockname VARCHAR 40

The type of block this is. Foreign key, references block.name.

parentcontextid BIGINT 19 null
context.id blocinst_par2_fk R

The context within which this block appears. Foreign key, references context.id.

showinsubcontexts SMALLINT 5 null

If 1, this block appears on all matching pages in subcontexts of parentcontextid, as well in pages belonging to parentcontextid.

requiredbytheme SMALLINT 5 0

If 1, this block was created because it was required by the theme and did not exist.

pagetypepattern VARCHAR 64

The types of page this block appears on. Either an exact page type like mod-quiz-view, or a pattern like mod-quiz-* or course-view-*. Note that course-view-* will match course-view.

subpagepattern VARCHAR 16 null

Further restrictions on where this block appears. In some places, e.g. during a quiz or lesson attempt, different pages have different subpage ids. If this field is not null, the block only appears on that particular subpage.

defaultregion VARCHAR 16

Which block region this block should appear in on each page, in the absence of a specific position in the block_positions table.

defaultweight BIGINT 19 null

Used to order the blocks within a block region. Again, may be overridden by the block_positions table for a specific page where this block appears.

configdata LONGTEXT 2147483647 null

A serialized blob of configuration data for this block instance.

timecreated BIGINT 19 null

Time at which this block instance was originally created

timemodified BIGINT 19 null

Time at which block instance was last modified.

Table contained -1 rows

block_instances table indexes

Constraint Name Type Sort Column(s)
PRIMARY Primary key Asc id
blocinst_par_ix Performance Asc parentcontextid
blocinst_parshopagsub_ix Performance Asc/Asc/Asc/Asc parentcontextid + showinsubcontexts + pagetypepattern + subpagepattern
blocinst_tim_ix Performance Asc timemodified

block_instances table relationships