aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Update/_1208.php
blob: 84025269483a8de058dd74385cce115ae6daf308 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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;

	}

}