Ticket/Migrations/202003280436145_addticketcount.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

namespace Gym.Model.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class addticketcount : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.TrainNumbers",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        TrainNum = c.String(),
                        Departure = c.String(),
                        Arrival = c.String(),
                        GoOff = c.DateTime(),
                        Seats = c.Int(nullable: false),
                        CreateTime = c.DateTime(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.TrainTickets",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        UserId = c.Int(nullable: false),
                        TrainNumberId = c.Int(nullable: false),
                        CreateTime = c.DateTime(),
                        State = c.Int(nullable: false),
                        OrderNum = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .ForeignKey("dbo.TrainNumbers", t => t.TrainNumberId, cascadeDelete: true)
                .ForeignKey("dbo.Users", t => t.UserId, cascadeDelete: true)
                .Index(t => t.UserId)
                .Index(t => t.TrainNumberId);
            
            CreateTable(
                "dbo.Users",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Account = c.String(),
                        Password = c.String(),
                        NickName = c.String(),
                        Remark = c.String(),
                        Role = c.Int(nullable: false),
                        CreateTime = c.DateTime(),
                    })
                .PrimaryKey(t => t.Id);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.TrainTickets", "UserId", "dbo.Users");
            DropForeignKey("dbo.TrainTickets", "TrainNumberId", "dbo.TrainNumbers");
后面还有 8 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。