added code to prevent panic if /login is reached but no settings exist

minor styling. added success and fail message to top of /signup screen
modified open_registration to boolean value in database
This commit is contained in:
Brad Rydzewski
2014-02-15 18:56:48 -07:00
parent a699e6ef09
commit 4b412d3a26
7 changed files with 38 additions and 25 deletions

View File

@@ -49,7 +49,7 @@ insert into builds values (9, 3, 'node_0.80', 'Success', '2013-09-16 00:00:00','
-- insert default, dummy settings
insert into settings values (1,'','','','','','','','','','localhost:8080','http');
insert into settings values (1,'','','','','','','','','','localhost:8080','http', 0);
-- add public & private keys to all repositories

View File

@@ -127,7 +127,7 @@ CREATE TABLE settings (
,smtp_password VARCHAR(1024)
,hostname VARCHAR(1024)
,scheme VARCHAR(5)
,open_invitations INTEGER
,open_invitations BOOLEAN
);
`
@@ -195,5 +195,9 @@ func Load(db *sql.DB) error {
db.Exec(buildCommitIndex)
db.Exec(buildSlugIndex)
// migrations for backward compatibility
db.Exec("ALTER TABLE settings ADD COLUMN open_invitations BOOLEAN")
db.Exec("UPDATE settings SET open_invitations=0 WHERE open_invitations IS NULL")
return nil
}

View File

@@ -112,7 +112,7 @@ CREATE TABLE settings (
,smtp_password VARCHAR(1024)
,hostname VARCHAR(1024)
,scheme VARCHAR(5)
,open_invitations INTEGER
,open_invitations BOOLEAN
);
CREATE UNIQUE INDEX member_uix ON members (team_id, user_id);