federated polls: add poll_author which will be necessary for Diaspora federation
This commit is contained in:
		
							
								
								
									
										26
									
								
								Zotlabs/Update/_1208.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								Zotlabs/Update/_1208.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,26 @@ | |||||||
|  | <?php | ||||||
|  |  | ||||||
|  | namespace Zotlabs\Update; | ||||||
|  |  | ||||||
|  | class _1208 { | ||||||
|  |  | ||||||
|  | 	function run() { | ||||||
|  |  | ||||||
|  | 		if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { | ||||||
|  | 			$r1 = q("ALTER TABLE poll ADD poll_author text NOT NULL"); | ||||||
|  |  			$r2 = q("create index \"poll_author_idx\" on poll \"poll_author\""); | ||||||
|  |  | ||||||
|  | 			$r = ($r1 && $r2); | ||||||
|  | 		} | ||||||
|  | 		else { | ||||||
|  | 			$r = q("ALTER TABLE `poll` ADD `poll_author` VARCHAR(191) NOT NULL AFTER `poll_votes`,  | ||||||
|  | 				ADD INDEX `poll_author` (`poll_author`)"); | ||||||
|  | 		} | ||||||
|  |  | ||||||
|  | 		if($r) | ||||||
|  | 			return UPDATE_SUCCESS; | ||||||
|  | 		return UPDATE_FAILED; | ||||||
|  |  | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | } | ||||||
							
								
								
									
										2
									
								
								boot.php
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								boot.php
									
									
									
									
									
								
							| @@ -54,7 +54,7 @@ define ( 'STD_VERSION',             '3.3.2' ); | |||||||
| define ( 'ZOT_REVISION',            '6.0a' ); | define ( 'ZOT_REVISION',            '6.0a' ); | ||||||
|  |  | ||||||
|  |  | ||||||
| define ( 'DB_UPDATE_VERSION',       1207 ); | define ( 'DB_UPDATE_VERSION',       1208 ); | ||||||
|  |  | ||||||
| define ( 'PROJECT_BASE',   __DIR__ ); | define ( 'PROJECT_BASE',   __DIR__ ); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -969,12 +969,14 @@ CREATE TABLE IF NOT EXISTS `poll` ( | |||||||
|   `poll_id` int(10) unsigned NOT NULL AUTO_INCREMENT, |   `poll_id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||||||
|   `poll_guid` varchar(191) NOT NULL, |   `poll_guid` varchar(191) NOT NULL, | ||||||
|   `poll_channel` int(10) unsigned NOT NULL DEFAULT 0 , |   `poll_channel` int(10) unsigned NOT NULL DEFAULT 0 , | ||||||
|  |   `poll_author` varchar(191) NOT NULL, | ||||||
|   `poll_desc` text NOT NULL, |   `poll_desc` text NOT NULL, | ||||||
|   `poll_flags` int(11) NOT NULL DEFAULT 0 , |   `poll_flags` int(11) NOT NULL DEFAULT 0 , | ||||||
|   `poll_votes` int(11) NOT NULL DEFAULT 0 , |   `poll_votes` int(11) NOT NULL DEFAULT 0 , | ||||||
|   PRIMARY KEY (`poll_id`), |   PRIMARY KEY (`poll_id`), | ||||||
|   KEY `poll_guid` (`poll_guid`), |   KEY `poll_guid` (`poll_guid`), | ||||||
|   KEY `poll_channel` (`poll_channel`), |   KEY `poll_channel` (`poll_channel`), | ||||||
|  |   KEY `poll_author` (`poll_author`), | ||||||
|   KEY `poll_flags` (`poll_flags`), |   KEY `poll_flags` (`poll_flags`), | ||||||
|   KEY `poll_votes` (`poll_votes`) |   KEY `poll_votes` (`poll_votes`) | ||||||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; | ||||||
|   | |||||||
| @@ -944,6 +944,7 @@ CREATE TABLE "poll" ( | |||||||
|   "poll_id" serial  NOT NULL, |   "poll_id" serial  NOT NULL, | ||||||
|   "poll_guid" text NOT NULL, |   "poll_guid" text NOT NULL, | ||||||
|   "poll_channel" bigint  NOT NULL DEFAULT '0', |   "poll_channel" bigint  NOT NULL DEFAULT '0', | ||||||
|  |   "poll_author" text NOT NULL, | ||||||
|   "poll_desc" text NOT NULL, |   "poll_desc" text NOT NULL, | ||||||
|   "poll_flags" bigint NOT NULL DEFAULT '0', |   "poll_flags" bigint NOT NULL DEFAULT '0', | ||||||
|   "poll_votes" bigint NOT NULL DEFAULT '0', |   "poll_votes" bigint NOT NULL DEFAULT '0', | ||||||
| @@ -952,6 +953,7 @@ CREATE TABLE "poll" ( | |||||||
| ); | ); | ||||||
| create index "poll_guid" on poll ("poll_guid"); | create index "poll_guid" on poll ("poll_guid"); | ||||||
| create index "poll_channel" on poll ("poll_channel"); | create index "poll_channel" on poll ("poll_channel"); | ||||||
|  | create index "poll_author" on poll ("poll_author"); | ||||||
| create index "poll_flags" on poll ("poll_flags"); | create index "poll_flags" on poll ("poll_flags"); | ||||||
| create index "poll_votes" on poll ("poll_votes"); | create index "poll_votes" on poll ("poll_votes"); | ||||||
| CREATE TABLE "poll_elm" ( | CREATE TABLE "poll_elm" ( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user