thedevdojo/voyager

Adding timestamps and soft deletes from table builder causes error

开放

#3,364 创建于 2018年6月29日

 (1 条评论) (0 个反应) (0 位负责人)PHP (2,652 个派生)batch import
help wantedopen for suggestionstype:enhancement

仓库指标

星标
 (11,817 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Version information

  • Laravel: v5.6.26
  • Voyager: v1.1.3
  • PHP: 7.2.7
  • Database: SQLite3 v3.11.0

Description

When creating a new table from within the Voyager control panel, then using the "+ Add timestamps" and "+ Add soft deletes" buttons results in an error that "timestamp" is not a valid datatype. The "timestamp" type is also not selectable in the drop-down menu, and other tables use a "datetime" field instead.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Menu > Tools > Database > Create new'
  2. Click on either the "+ Add timestamps" or "+ Add soft delete"
  3. Error message should appear in the top-right. The data types default to "time" instead.

Expected behavior

Since SQLite3 does not internally support timestamps, auto-select another default value that does work, for example "datetime" as the other generated tables are set to.

Additional context

This application is only using an SQLite3 database in the development environment.

贡献者指南