-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #338 from mikefranze/kyesly-integration
Kyesly integration
- Loading branch information
Showing
16 changed files
with
948 additions
and
609 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { Kysely } from 'kysely' | ||
|
||
export async function up(db: Kysely<any>): Promise<void> { | ||
await db.schema | ||
.createTable('electionDB') | ||
.addColumn('election_id', 'varchar', (col) => col.primaryKey()) | ||
.addColumn('title', 'varchar') | ||
.addColumn('description', 'text') | ||
.addColumn('frontend_url', 'varchar') | ||
.addColumn('start_time', 'varchar') | ||
.addColumn('end_time', 'varchar') | ||
.addColumn('support_email', 'varchar') | ||
.addColumn('owner_id', 'varchar') | ||
.addColumn('audit_ids', 'json') | ||
.addColumn('admin_ids', 'json') | ||
.addColumn('credential_ids', 'json') | ||
.addColumn('state', 'varchar') | ||
.addColumn('races', 'json', (col) => col.notNull()) | ||
.addColumn('settings', 'json') | ||
.addColumn('auth_key', 'varchar') | ||
.execute() | ||
|
||
await db.schema | ||
.createTable('electionRollDB') | ||
.addColumn('voter_id', 'varchar', (col) => col.primaryKey().notNull()) | ||
.addColumn('election_id', 'varchar', (col) => col.notNull()) | ||
.addColumn('email', 'varchar') | ||
.addColumn('submitted', 'boolean', (col) => col.notNull()) | ||
.addColumn('ballot_id', 'varchar') | ||
.addColumn('ip_address', 'varchar') | ||
.addColumn('address', 'varchar') | ||
.addColumn('state', 'varchar', (col) => col.notNull()) | ||
.addColumn('history', 'json') | ||
.addColumn('registration', 'json') | ||
.addColumn('precinct', 'varchar') | ||
.addColumn('email_data', 'json') | ||
.execute() | ||
|
||
await db.schema | ||
.createTable('ballotDB') | ||
.addColumn('ballot_id', 'varchar', (col) => col.primaryKey().notNull()) | ||
.addColumn('election_id', 'varchar') | ||
.addColumn('user_id', 'varchar') | ||
.addColumn('status', 'varchar') | ||
.addColumn('date_submitted', 'varchar') | ||
.addColumn('ip_address', 'varchar') | ||
.addColumn('votes', 'json', (col) => col.notNull()) | ||
.addColumn('history', 'json') | ||
.addColumn('precinct', 'varchar') | ||
.execute() | ||
} | ||
|
||
export async function down(db: Kysely<any>): Promise<void> { | ||
await db.schema.dropTable('electionDB').execute() | ||
await db.schema.dropTable('electionRollDB').execute() | ||
await db.schema.dropTable('ballotDB').execute() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Ballot } from "../../../domain_model/Ballot"; | ||
import { Election } from "../../../domain_model/Election"; | ||
import { ElectionRoll } from "../../../domain_model/ElectionRoll"; | ||
|
||
export interface Database { | ||
electionDB: Election, | ||
electionRollDB: ElectionRoll | ||
ballotDB: Ballot | ||
} |
Oops, something went wrong.