Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for Muto (0.16 sec)

  1. tests/embedded_struct_test.go

    		ImageUrl string
    	}
    
    	DB.Migrator().DropTable(&HNPost{}, &EngadgetPost{})
    	if err := DB.Migrator().AutoMigrate(&HNPost{}, &EngadgetPost{}); err != nil {
    		t.Fatalf("failed to auto migrate, got error: %v", err)
    	}
    
    	for _, name := range []string{"author_id", "author_name", "author_email"} {
    		if !DB.Migrator().HasColumn(&EngadgetPost{}, name) {
    			t.Errorf("should has prefixed column %v", name)
    		}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  2. tests/soft_delete_test.go

    		Pages     uint
    		DeletedAt gorm.DeletedAt `gorm:"zeroValue:'1970-01-01 00:00:01'"`
    	}
    	DB.Migrator().DropTable(&SoftDeleteBook{})
    	if err := DB.AutoMigrate(&SoftDeleteBook{}); err != nil {
    		t.Fatalf("failed to auto migrate soft delete table")
    	}
    
    	book := SoftDeleteBook{Name: "jinzhu", Pages: 10}
    	DB.Save(&book)
    
    	var count int64
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 5.7K bytes
    - Viewed (0)
  3. tests/postgres_test.go

    	for _, column := range columns {
    		if column.Name() == "log_id" {
    			hasLogID = true
    			autoIncrement, ok := column.AutoIncrement()
    			if !ok || !autoIncrement {
    				t.Fatalf("column log_id should be auto incrementment")
    			}
    		}
    	}
    
    	if !hasLogID {
    		t.Fatalf("failed to found column log_id")
    	}
    }
    
    type Post struct {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  4. migrator.go

    	tx := db.getInstance()
    
    	// apply scopes to migrator
    	for len(tx.Statement.scopes) > 0 {
    		tx = tx.executeScopes()
    	}
    
    	return tx.Dialector.Migrator(tx.Session(&Session{}))
    }
    
    // AutoMigrate run auto migration for given models
    func (db *DB) AutoMigrate(dst ...interface{}) error {
    	return db.Migrator().AutoMigrate(dst...)
    }
    
    // ViewOption view option
    type ViewOption struct {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  5. migrator/column_type.go

    // PrimaryKey returns the column is primary key or not.
    func (ct ColumnType) PrimaryKey() (isPrimaryKey bool, ok bool) {
    	return ct.PrimaryKeyValue.Bool, ct.PrimaryKeyValue.Valid
    }
    
    // AutoIncrement returns the column is auto increment or not.
    func (ct ColumnType) AutoIncrement() (isAutoIncrement bool, ok bool) {
    	return ct.AutoIncrementValue.Bool, ct.AutoIncrementValue.Valid
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  6. README.md

    * Context, Prepared Statement Mode, DryRun Mode
    * Batch Insert, FindInBatches, Find To Map
    * SQL Builder, Upsert, Locking, Optimizer/Index/Comment Hints, NamedArg, Search/Update/Create with SQL Expr
    * Composite Primary Key
    * Auto Migrations
    * Logger
    * Extendable, flexible plugin API: Database Resolver (Multiple Databases, Read/Write Splitting) / Prometheus…
    * Every feature comes with tests
    * Developer Friendly
    
    ## Getting Started
    
    Plain Text
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Nov 07 02:20:06 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  7. tests/tests_test.go

    	if err = DB.Migrator().DropTable(allModels...); err != nil {
    		log.Printf("Failed to drop table, got error %v\n", err)
    		os.Exit(1)
    	}
    
    	if err = DB.AutoMigrate(allModels...); err != nil {
    		log.Printf("Failed to auto migrate, but got error %v\n", err)
    		os.Exit(1)
    	}
    
    	for _, m := range allModels {
    		if !DB.Migrator().HasTable(m) {
    			log.Printf("Failed to create table for %#v\n", m)
    			os.Exit(1)
    		}
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 3.3K bytes
    - Viewed (1)
Back to top