36 lines
		
	
	
		
			715 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
		
		
			
		
	
	
			36 lines
		
	
	
		
			715 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| 
								 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @file
							 | 
						||
| 
								 | 
							
								 * Install, update and uninstall functions for the Ban module.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * Implements hook_schema().
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								function ban_schema(): array {
							 | 
						||
| 
								 | 
							
								  $schema['ban_ip'] = [
							 | 
						||
| 
								 | 
							
								    'description' => 'Stores banned IP addresses.',
							 | 
						||
| 
								 | 
							
								    'fields' => [
							 | 
						||
| 
								 | 
							
								      'iid' => [
							 | 
						||
| 
								 | 
							
								        'description' => 'Primary Key: unique ID for IP addresses.',
							 | 
						||
| 
								 | 
							
								        'type' => 'serial',
							 | 
						||
| 
								 | 
							
								        'unsigned' => TRUE,
							 | 
						||
| 
								 | 
							
								        'not null' => TRUE,
							 | 
						||
| 
								 | 
							
								      ],
							 | 
						||
| 
								 | 
							
								      'ip' => [
							 | 
						||
| 
								 | 
							
								        'description' => 'IP address',
							 | 
						||
| 
								 | 
							
								        'type' => 'varchar_ascii',
							 | 
						||
| 
								 | 
							
								        'length' => 40,
							 | 
						||
| 
								 | 
							
								        'not null' => TRUE,
							 | 
						||
| 
								 | 
							
								        'default' => '',
							 | 
						||
| 
								 | 
							
								      ],
							 | 
						||
| 
								 | 
							
								    ],
							 | 
						||
| 
								 | 
							
								    'indexes' => [
							 | 
						||
| 
								 | 
							
								      'ip' => ['ip'],
							 | 
						||
| 
								 | 
							
								    ],
							 | 
						||
| 
								 | 
							
								    'primary key' => ['iid'],
							 | 
						||
| 
								 | 
							
								  ];
							 | 
						||
| 
								 | 
							
								  return $schema;
							 | 
						||
| 
								 | 
							
								}
							 |