Skip to content

Commit

Permalink
Merge pull request #24 from Casperhr/master
Browse files Browse the repository at this point in the history
Id will default be UNSIGNED INT(10)
  • Loading branch information
tanner0101 authored Jan 2, 2017
2 parents cb261cc + fcf4e62 commit 6dafd3b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/FluentMySQL/MySQLSerializer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public final class MySQLSerializer: GeneralSQLSerializer {
public override func sql(_ type: Schema.Field.DataType) -> String {
switch type {
case .id:
return "INT(11) PRIMARY KEY AUTO_INCREMENT"
return "INT(10) UNSIGNED PRIMARY KEY AUTO_INCREMENT"
case .int:
return "INT(11)"
case .string(let length):
Expand Down
5 changes: 4 additions & 1 deletion Tests/FluentMySQLTests/JoinTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import FluentTester

class JoinTests: XCTestCase {
static let allTests = [
("testBasic", testBasic)
("testBasic", testBasic),
("testTester", testTester),
("testCreate", testCreate),
]

var database: Fluent.Database!
Expand Down Expand Up @@ -52,6 +54,7 @@ class JoinTests: XCTestCase {
func testTester() {
let tester = Tester(database: database)
do {
try database.delete("students")
try tester.testAll()
} catch {
XCTFail("\(error)")
Expand Down
2 changes: 1 addition & 1 deletion Tests/FluentMySQLTests/Utilities/MySQLDriver+Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension MySQLDriver {
print("Error: \(error)")
print()
print("You must configure MySQL to run with the following configuration: ")
print(" user: 'travis'")
print(" user: 'root'")
print(" password: '' // (empty)")
print(" host: '127.0.0.1'")
print(" database: 'test'")
Expand Down
1 change: 1 addition & 0 deletions Tests/FluentMySQLTests/Utilities/User.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Fluent

final class User: Entity {
var exists = false
var id: Fluent.Node?
var name: String
var email: String
Expand Down
2 changes: 2 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import XCTest

XCTMain([
testCase(MySQLDriverTests.allTests),
testCase(MySQLDriverTests.allTests),
testCase(SchemaTests.allTests),
])

#endif

0 comments on commit 6dafd3b

Please sign in to comment.