Extension:CentralNotice/cn assignments table

From mediawiki.org

Fields[edit]

Associates banners to campaigns and sets any banner metadata that is campaign specific and not many to one.

Key Name Type Default Description
primary asn_id int(11) NOT NULL AUTO_INCREMENT NULL Assignment ID


not_id int(11) NOT NULL NULL Foreign key to the cn_notices table; identifying the campaign.


tmp_id int(11) NOT NULL NULL Foreign key to the cn_templates table; identifying the banner.


tmp_weight int(11) NOT NULL NULL Integer weight that shows the priority that this banner has relative to others. As of v2.3 this is restricted to the range 1 - 100 inclusive and is relative only within the associated campaign.


asn_bucket tinyint(1) 0 Foreign key. Bucket this banner is assigned. Should not be greater than not_buckets in the cn_notices table.

Schema[edit]

+------------+------------+------+-----+---------+----------------+
| Field      | Type       | Null | Key | Default | Extra          |
+------------+------------+------+-----+---------+----------------+
| asn_id     | int(11)    | NO   | PRI | NULL    | auto_increment |
| not_id     | int(11)    | NO   | MUL | NULL    |                |
| tmp_id     | int(11)    | NO   | MUL | NULL    |                |
| tmp_weight | int(11)    | NO   |     | NULL    |                |
| asn_bucket | tinyint(1) | YES  | MUL | 0       |                |
+------------+------------+------+-----+---------+----------------+

Indexes[edit]

+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table          | Non_unique | Key_name   | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| cn_assignments |          0 | PRIMARY    |            1 | asn_id      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| cn_assignments |          1 | asn_not    |            1 | not_id      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| cn_assignments |          1 | asn_tmp    |            1 | tmp_id      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| cn_assignments |          1 | asn_bucket |            1 | asn_bucket  | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+