Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

35 wiersze
897 B

  1. //
  2. // File.swift
  3. //
  4. //
  5. // Created by Bill Ryckman on 4/26/23.
  6. //
  7. import Vapor
  8. import Fluent
  9. struct CreateFuelEntry: AsyncMigration {
  10. func prepare(on database: Database) async throws {
  11. try await database.schema("fuel_entries")
  12. .id()
  13. .field("timestamp", .datetime)
  14. .field("user_id", .string)
  15. .field("gps_location", .string)
  16. .field("image", .string)
  17. .field("product", .string)
  18. .field("make", .string)
  19. .field("model", .string)
  20. .field("serial_number", .string)
  21. .field("tank_id", .string)
  22. .field("fuel_amount", .double)
  23. .field("fuel_type", .string)
  24. .field("is_override", .bool)
  25. .create()
  26. }
  27. func revert(on database: Database) async throws {
  28. try await database.schema("fuel_entries").delete()
  29. }
  30. }